Set value of hidden database item

I have a simple non-tabular form for creating rows in a table. I need to set the value of a hidden database item to be the same as a database item which the user enters.
I know this can be done by a database trigger and also by a custom update process, but is there other (simpler) way to do this ?
Vincent

Vincent,
By "hidden database item", I'm assuming that you mean a column in a table. By "database item which the user enters", I'm assuming that you mean a page item on your form. If that's correct, just edit that item in the builder, making its source type 'Database Column' and its source the column name, and the automatic row fetch and DML processes on the page will take care of the rest. If you mean something else, let us know.
Scott

Similar Messages

  • How to access each row value for a database item

    On my form I have a database datablock that represents a table in my database.
    5 rows are shown with a scroll bar that can be viewed to show the rest.
    The user is able to change some of the Database Item values represented in this datablock for any row shown in the datablock.
    I need to validate the correctness of the users change before allowing the database datablock to update the table in the database.
    But a database item in a datablock will represent a value for every row in the table. So how do I access each row value for a database item separately. What is the PL/SQL syntax?
    thanks,
    michelle

    In my situation it was better to use the loop instead
    of a when validate trigger because...Well it was clearly not better to use a loop that doesn't work. I don't understand what you're not clear on about the item and record validation triggers. If you have a specific validation rule for a single field (such as a date that cannot be in the future), that would go in a When-Validate-Item trigger on the date item. If the user enters a future date, your code would display an error message and raise a failure. Raising a failure prevents the item from being marked as valid. Invalid items prevent the record from being inserted/updated. Sometimes you have a validation rule that requires looking at more than one item at a time, such as two items that must either both be NULL or NOT NULL. In that case, you could not use a When-Validate-Item trigger because you can't clear or populate both at once. So then you would use a When-Validate-Record at the block level and if one field is NULL and the other isn't, you would display an error message and raise a failure. Forms is very civil in this respect; we don't throw exceptions around here, but then I digress.

  • Javascript: set value of hidden item

    Hi,
    I have a select list and a hidden item on my page, after select a value, I want to write this value (and a little bit more) to the hidden item.
    So I have done the following...
    applied to page html header:
    <script language="JavaScript" type="text/javascript">
    function setExpress(item_id)
    html_GetElement('P230_HIDDEN').value = 'Test ' + html_GetElement(item_id).value;
    </script>
    and in selection list I set the HTML Form Element Attributes to onChange="setExpress(this.id); .
    But nothing is written to the hidden item. When I make it a text field it works correct.
    Isn't it possible to set a value of hidden item by javascript? Is there another way to do this (without computation)?
    Thanks for help
    chrissy

    Hello chrissy,
    I don't see the connection between the item being Hidden or Text. The item id stays the same, and so the JavaScript reference to it.
    It is possible to assign values to hidden items using JavaScript, just as you did. In the following page - http://htmldb.oracle.com/pls/otn/f?p=22814:8
    -you can see a working example of your situation – select list populate a hidden item, then display by using alert.
    After selecting from the list you should TAB out, so it will fire the JavaScript event. In your example, you were using onChange. I think that could be problematic in cases were the default value (first value) of the select list is the one chosen – no change there. In my example, I'm using onBlur.
    You can see the JavaScript on the source page.
    Hope this help,
    Arie.

  • Hidden Database Items - Using Non-database Items

    I am making my first form. It is based on a table having three columns, two are IDs (primary keys) for other tables ( org_organization_definitions and po_vendors ), and one is an enabled_flag containing either Y or N. In my form I need to hide the IDs of the underlying table, but display the organization_code and vendor_name from the IDs of the records from their respective home tables, and be able to query records by organization_code and vendor_name.
    I have tried two methods:
    In the first I created a block from the table with the ID and enabled_flag columns, and manually created text items for organization_code and vendor_name that are not database items and manually fill them in the post-query trigger of the block. The problem I ran into with this method was that I did not know how to use the manual text items for searching, and I could not get the LOVs to behave as expected as with database items.
    In the second method, I created a view with all of the data that I needed to display, and based the block on that. Of course I cannot update or insert into the view, so I wanted to handle the updates and inserts manually with my own DML statements. With this method I have two problems, I don’t know how to bypass the form runtime not wanting to let me update values, and once I do, I am not sure how to manually go through each record to check to see if it has been changed or not.
    I am not sure if either of my methods are the only two options or the best ways. Any help you can provide me with in this matter is appreciated.
    Thank You,
    Ryan

    hi,
    I have a requirement where I have to use existing database(OLTP) as my source to the SSAS cubes and then to build the reports.
    Where for Cubes and Reports I uses SQL Server BI edition. But my existing source data will be in non BI database.
    My questions are
    1) Can I create Fact and Dimension Model in Non BI Db and connect the same to SSAS and SSRS? What you suggest?
    2) Can I use cubes and reports without modifying the existing OLTP DB structure to fact and Dimension? 
    Thanks
    Naveen
    1. Yes. you can
    It doesnt necessary need to set up a OLAP system. However making design inline with OLAP would be easier to implement in SSAS
    2. Again yes
    But using OLTP designed tables in SSAS/SSRS would require some additional overheads at querying level like referenced lookups in SSAS vs lots of joins in backend queries in SSRS.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Setting values to Display Only item during AJAX request

    Hello,
    Good Morning!
    In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE.  Values are populated with out any issue. 
    However, as soon as I make those two fields as Display Only, the values are not getting set.  Is there a way to set the values to a field in the same time it should be restricted for user to change it?
    (APEX 4.2.6)
    Thanks,
    -Anand

    Hi Anand,
    anand_gp wrote:
    Hello,
    Good Morning!
    In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE.  Values are populated with out any issue.
    However, as soon as I make those two fields as Display Only, the values are not getting set.  Is there a way to set the values to a field in the same time it should be restricted for user to change it?
    (APEX 4.2.6)
    check the example
    Step 1: Edit your page
    under CSS->Inline put the code given below
    .row_item_disabled {
       cursor: default;
       opacity: 0.5;
       filter: alpha(opacity=50);
       pointer-events: none;
    Step 2 : I guess you have Javascript function similar like given below
    you have to extract rowid first, for which you want to set the percentage , see line 6
    and see line 18, for disabling the column of that row.
    <script type="text/javascript">
       function f_fetch_tax_percentage(pThis) {
       var ajaxRequest;
       var ajaxResult;
       var row_id = pThis.id.substr(4);
       var percentage    = 'f05_' + row_id;   // replace f05 with the rowid of percentage column
       ajaxRequest = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=TAX_DTLS',0);
       ajaxRequest.addParam('x01',$v(pThis));
       ajaxResult = ajaxRequest.get();
       if ( ajaxResult.length > 0 ) {
       // set percentage
       $('#'+percentage).val(parseFloat(ajaxResult));
       // disable percentage column
       $("#f05_" + row_id).attr("readonly", true).addClass('row_item_disabled');        
    </script>
    Hope this helps you,
    Regards,
    Jitendra

  • How to set values in a JSP from DTO

    My requirement is to print matrix report of students and their subject markets
    Student Name | Sub1 Sub 2 ...........
    Std Name1
    Std Name 2
    That is printing subject names horizontally and student names vertically.
    <c:forEach items="${dto.subList}" var="item" varStatus="count">
              td><c:out value="${item.sub_name}"/> </td>
    </c:forEach>
    <tr>
    <c:forEach items="${dto.StudentsList}" var="item" varStatus="count">
    <c:set value="${count.count}" var="totalstudents"/>
    <tr class="odd">
         <td><c:out value="${item.student_name}"/> </td>
    <c:forEach items="${dto.subList}" var="item" varStatus="count">
         <c:set value="${dto.marksList}" var="item"/>
          </td>
    </c:forEach>     
    </tr></c:forEach>
    i have done upto this part. wat i need is for each student it needs to check sub1 and soon and put that marks in that sub place

    public DTO GenerateMatrixReport(DTO params) throws DAOException
         DTO resultDto = new DTO();
    int totalstudents = new Integer(params.get("totalstudents").toString()).intValue();
    int totalsubjects = new Integer(params.get("totalsubjects").toString()).intValue();
         for(int i=1;i<=totalstudents;i++)
              List list = new ArrayList();
         for(int j=1;j<=totalsubjects;j++)
                   list = new ArrayList();
         list.add(params.get("email"+i));
                   list.add(params.get("subject_name"+j));
                   list.add(changeDateToDBFormat((String)params.get("start_date")));
                             list.add(changeDateToDBFormat((String)params.get("end_date")));
                             DTO tempDto = super.get("SQL QUERY",list);
                             if(null != tempDto.getDataList());
                                  List l1=new ArrayList();
                                  l1 = tempDto.getDataList();
                                  if(l1 != null)
                                       for(int k=0;k<l1.size();k++)
                                            Map m =(Map)l1.get(k);
                                            m.put("marks",""+new Double(m.get("marks").toString()).doubleValue());
                                            tempList.add(m);
                                  else
                                       System.out.println(0);
                   resultDto.put("ubjectList",getAllSujectNames());
                   resultDto.put("studentsList",getAllStudents());
                   resultDto.put("marksList",tempList);
                   return resultDto;
              public Collection getAllSujectNames() throws DAOException
                   Collection list = new ArrayList();
                   DTO resultDto = super.get(Utility.getSQL("getallsubjectnames"),new ArrayList());
                   if(null != resultDto.getDataList())
                        List tempList = resultDto.getDataList();
                        for(int i=0;i<tempList.size();i++)
                             Map m = (Map)tempList.get(i);
                             m.put("subject_name",m.get("subject_name"));
                             list.add(m);
                   return list;
              public Collection getAllStudents() throws DAOException
                   Collection list = new ArrayList();
                   DTO resultDto = super.get(Utility.getSQL("getallstudents"),new ArrayList());
                   if(null != resultDto.getDataList())
                        List tempList = resultDto.getDataList();
                        for(int i=0;i<tempList.size();i++)
                             Map m = (Map)tempList.get(i);
                             m.put("student_name", m.get("first_name") + " " + m.get("last_name"));
                             m.put("email",m.get("email"));
                             list.add(m);
                   return list;
    These are the methods iam using ,can u set me the solution to print the values in matrix format

  • Best Way To Set values In Items

    Hello,
    I have a two database items and dynamically I would like to assign values to those items.
    What is the best way of accomplishing this task?
    Is there any SET property available or I need to like
    block_name.item_name :='Value'
    Regards

    You can use COPY built-in to perform dynamically assign values to different items.

  • Setting default value of Tabular form item is not working

    Hi,
    I have a tabular form and in that I want to set the default value of the username to app_user. So in the default value of the item, I wrote v('app_user') and type Pl/SQL, but that does not seem to work. I tried the static application & page item with :app_user. That threw an error.
    Also, I wanted to populate the date field in one column. Doesn't sysdate work?
    Thanks,
    Sun

    Bob, I did read that. MY problem is that it is still not working. I am wondering if this is because the table is in execute query mode maybe? I am wondering if the default value needs to be added after the tabular data is populated through some other way? Maybe the default value would work only for static non database items?
    ThanksYou're right, I just tested that using the default setup on the column in report attributes and it did not work.
    I think you'll have to update the columns with the default value post query but I'm not sure exactly what you need to do.
    I have a form that has a weight entry column. I tried changing the query to set the default value in the query
    from..
    Select Weight
    From...
    to
    Select 999.99 Weight
    From...That appeared to work, but the 999.99 value was not populated back to the Database since it wasn't entered through the form UI. APEX maintains the entered values internally so it can do its checksumm processing and update modified rows back to the DB. I'm thinking you could update what needs to be updated using Javascript in a Dynamic Action, but I'm afraid I don't know how to do that.
    Excuse my incorrect assumption when first replying.

  • Setting values for items other than default value

    How can I set the value of Items (hidden item, display item etc) without using any of navigational control such as list, select list or tree?
    I have a two report region on a page and no navigation control. the requirement is only one region should be displayed at one point of time.
    Condition that drives this are passed from other page through links.
    The code is like this
    For Region A
    select * from table a where cola = :P_VALUE_FROM_OTHER_PAGE; //value passed is JOE
    For Region B
    select * from table a where cola = :P_VALUE_FROM_OTHER_PAGE; //value passed is JOHNnow there is the hidden item :P_HIDDEN that i am comparing in expression1 = expression2 conditions for each region
    for e.g.
    for region A
    value in expression1 = expression2
    P_HIDDEN = 1
    for region B
    P_HIDDEN = 2my issue is, where can I set values for P_HIDDEN item (set to 1 and set to 2) without any navigational control on the page.
    Thanks,
    R
    now there is the hidden item :P_HIDDEN that i am comparing in expression1 = expression2 conditions for each region
    for e.g.
    for region A
    value in expression1 = expression2
    P_HIDDEN = 1
    for region B
    P_HIDDEN = 2
    my issue is, where can I set values for P_HIDDEN item (set to 1 and set to 2) without any navigational control on the page.
    Thanks,
    R
    Edited by: Rich V on May 21, 2010 10:41 PM

    The question I would ask is:
    How are you determining which region you want to be displayed by default?
    Either way, you could potentially use a 'before header' computation to calculate the value of your hidden item, although you'd also need to include some sort of conditional means of preventing the computation from running everytime to run the page (otherwise you'd never see your other region) e.g. you might only want it to run if the hidden item is null.

  • Setting value of items based on a radio group selection

    Hi,
    I have a radio group with 3 values (let's say A, B, C)... at the moment I have dynamic actions set to hide and unhide items based on the selection from the radio group...
    e.g when value A is selected then only item_1 and item_2 are displayed, when value B is selected then only item_3 and item_4 are displayed... and so on...
    idea was to let users to only enter information related to specific selection... but with what I currently have, users can select option A from the radio group and can enter information in item_1 and item_2 and then they can change there minds and select option B and start entering information in item_3 and item_4 and when they save the form they potentially could have information in all items (item_1 to item_4 and so on)...
    Is there a way I can set the value of certain items to null based on the selection from the radio group... e.g when user select option A, then values of item_3 and item_4 be set to null and if they select option B, then values of item_1 and item2 be set to null...
    Please advice how to approach it the best... I would appreciate a step by step solution as I am a new bee...
    Thanks in advance

    Hi,
    You can hide and disable other items.
    Disabled items values are not submitted.
    And you can create after submit computation that set NULL to item session state according your radio group state
    Regards,
    Jari

  • How to set the default value of a database column to NULL

    Hello,
    I want to set the default value of a column (VARCHAR2(20) to NULL, nut I cannot figure out to do this. I tried the following editing the offline table with JDeveloper:
    Default Value : <empty> -> On database NULL
    Default Value: '' -> On database ''
    When I create a new column, there is no default value on the database side and when I open the tabe properties in the database navigator I can see that the default value is (null). This is what I want to see in the other column as well. I don't know why sometimes a default value is visible on the database side (when generating form offline tables to database tables) and sometimes not.
    Perhaps sombody can bring some light in this issue.
    Thanks Thomas

    Hello Shay,
    I have the impression that you don't understand my problem. So here step by step:
    1. Create a offline Table TEST with one column TEST: VARCHAR2(20). nullable=true, no default value.
    2. Generate the table to the database
    3. When you look at the table properties (columns) with the database navigator the following information is displayed (sorry for the formatting):
    Column Name | Data Type | Nullable | Data Default | COLUMN ID| Primary Key | COMMENTS
    TEST | VARCHAR2(20 BYTE | Yes | (null) | 1 | (null) | (null)
    4. Now set the default value for the column TEST in the offline table for example to 'Test'
    5. Generate the table to the database.
    6. When you have a look at the database table, the default value is now 'Test' (as expected)
    7. Now remove the default value of the column TEST in the offline table
    8. Generate the table to the database
    9. When you have a look at the database table, the default value is now NULL (in uppercase letters without parenthesis)
    And this is where the problem starts!
    When you generate the table again with the options "Alter/Manual Reconcile" the default value of the column test is considered to be different! But in fact it should'nt be different because nothing has been changed.
    Best regards Thomas
    Edited by: thmayr on May 28, 2009 9:05 AM
    Edited by: thmayr on May 28, 2009 9:31 AM

  • Mapping in BPM - set value of collection item

    Hello,
    is it possible to set value to exact item of collection in mapping step in netweaver BPM?
    I need something like set(<collection_variable>,<item_index>,<item_value>)  - so exact opposite of GET generic function, which gets specific item from collection.
    Is it possible in NW BPM?

    You dont have to apologize. I didnt meant that as offend.
    I appreciate the possibility to discuss that topic with somebody, because discussion itself sometimes shows other perspective to the problem, which can lead to solution
    Of course I wrote EJB function to solve that - but I cant believe that it isnt standard solution to that pretty common use case.
    I think, that problem lays in very limited implementation of XPath into Netweaver BPM. I will bet my left hand, that in some future SP of BPM will SAP introduce something like this:
    myCollection[1]/notificationId = notificationId
    which is standard XPath way to do that

  • Setting value of an item using item_id

    howdy,
    You know when you set value of a text or display item using its name, ie:
    :block_name.item_name := 'abc';
    Well, I would like to do the same, but using its item_id.
    Can it be done?
    The reason behind it is that, I have 50 text items on canvas. They all follow some naming convention, and I would like to set their values in some elegant loop, rather than writing a page-long code referencing their :block_name.item_name.
    thanks and kind regards
    mz.

    Would the COPY built-in work for you? For example 50 items called genericItem1, genericItem2, ...
    for i in 1..50 loop
    COPY('new value', 'block.genericItem' || to_char(i));
    end loop;
    Regards,
    Candace Stover
    Forms Product Management

  • How to Set Value of page item?

    String dimLayoutNew[][] = new String[3][];
    dimLayoutNew[0] = new String[1];
    dimLayoutNew[1] = new String[1];
    dimLayoutNew[2] = new String[2];
    dimLayoutNew[0][0] = measureString;
    dimLayoutNew[1][0] = strDimension1;
    dimLayoutNew[2][0] = strDimension2;
    dimLayoutNew[2][1] = strDimension3;
    Boolean applyNewLayoutFlag = tableQuery.layout(dimLayoutNew);
    In this Layout,How to set the value of strDimension2 page item to one member of strDimension2?
    thanks!

    what about this - look up the javadoc to get more >info ....You would have to admit, while BI Beans are great, the documentation is a little light.
    int targetHPos[] = targetDataAccess.getEdgeCurrentHPos (2);
    now apply the order to the targethpos as you like...now, once you make your changes to the targetHPos, how does one actually make the change to the Query object (i.e. what method does one need to call to pass the new targetHPos in??) I looked through the JavaDoc and didn't see a SetCurrentHPos or equivalent function in the DataAccess Class. Is there one?
    Also, what role, if any, should the SetCurrentPage method of the query object play if I'm not using it correctly?

  • Setting custom table attribute set value in region item table

    Dear all
    I am working on oracle application customization and extension in
    oracle JDeveloper R12. I am finding a difficulty in an query region of
    a OA framework page
    My Entity object is on the table FWK_TBX_ADDRESS table
    and VO objects has the fields or columns
    AddressName, AddreessId, TownC-OrCity
    what I am doing shown in the following steps
    1-I select region using wizard option
    2-select my AM and VO
    3-select table as style
    4-shuttle all attributes associated with VO
    5-in region items table , select the Attribute set field for AddressName attribute and click the serach flashligh icon
    6-After that select the browse button , using the package browser , expand down to oracle > apps > fnd> framwork > toolbox > attributesets, then oK
    7-select the serach control , and then it list all the attributes set related to fwkTbxEmployees table like the following
    /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    Now the problem which I am facing now is that if I have custom table suppose "xxEmployees" and have attributes or column
    for example employeeId, employee_name, email etc. what would I do to search these attributes when I come to step number 6 which
    I mentioned above. from where in which package I can find these attributes to set attributesset value. in above i find these attributes
    in /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    but in my case for attribute lie employeeId or employee_name from where I can get this how can I set the value of attribute set field in regin item
    table in step 5
    Noman

    I dont know what u trying to ask
    My problem is just that I want to set the attribute set value of my attribute employee_name, same is AddressId in fwk_tbx_address
    ame is AddressId in fwk_tbx_address found on
    /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    where can I find my attribute employee_name
    in jdeveloper

Maybe you are looking for

  • Receiver mail adapter doubt

    Hello, I use XIPAYLOAD as message protocol and selected the option Mail Package. In mapping, I fill the sender, receiver mail ids, subject, content. Now, the content of the received mail is available from 12-15 fields from the input structure. I want

  • Link db results to Dropdown list and link to email

    I need to pull information from a table 'Suppliers' in an (datebase.mdb) and retrieve two items, name and email. This in itself Dreamweaver makes fairly simple. From this information I need to produce a dropdown list, again Dreamweaver makes this sim

  • Watch DVDs on tv from macbook?

    Is there a way to play DVDs on my macbook and view them on my flatscreen HD tv? I purchased the connection cables from the applestore and can watch movies that are downloaded onto the hard drive, but when I try to watch a dvd, it shows on the macbook

  • Material group values in Sales Order

    In sales Order Additional data A tab /Item level, I need to add drop down vales for all material Groups could someone let me know what is the tcode to be used. Thanks in advance Satprk

  • ROKR not showing up on iTunes 6

    ITunes doesn't list the phone and it's not visible on the desktop. The phone says it is connected as storage device, but I can see it only at the profiler. Can anybody help me? Bye, Kathrin