Unable to pick tabular form value....

selecT NVL(SUM(QUANTITY1),0) from RM_LOCATION1 where LOCATION1 = :P3_LOCATION1;+
where location1 is column of my tabular form...
apex doesn't picks these value (i.e :P3_LOCATION1)
as apex treat it as an array... (:P3_LOCATION1)
can any one help how can I make my these query run...

Hi Shirish!
I don't know exactly what your trying to achieve. Obviously a custom validation (pl/sql returning error text).
Does your report contain several different departments or only rows for one department?
Without knowing your layout and demands I fear I cannot help any more.
If your report contains only one department and several rows adding for the total commission you could try:
DECLARE
  vsum      NUMBER;
  vsumcheck NUMBER;
BEGIN
  APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION( p_collection_name => 'VALIDATE');
  FOR j IN 1..APEX_APPLICATION.G_F02.count
  LOOP
    APEX_COLLECTION.ADD_MEMBER(
              p_collection_name => 'VALIDATE',
              p_c001 => APEX_APPLICATION.G_F04(j)
  END LOOP;
begin
    select sum(to_number(c001)) into vsum FROM apex_collections a
        WHERE a.collection_name = 'VALIDATE';
exception when invalid_number then
    return 'Attention! The Commission must be numeric!';
end;
IF vsum > 1000 THEN
    RETURN 'The commission cannot be higher than 1000 for a department! <br>
Please correct your input!';
  END IF;
END;Otherwise you should declare your variable x as number:
DECLARE
l_error VARCHAR2 (4000);
x number(10);
BEGIN
FOR i IN 1 .. apex_application.g_f02.COUNT
LOOP
select sum(nvl(QUANTITY1,0)) INTO x from RM_LOCATION1 where LOCATION1 = apex_application.g_f04(i);
IF x > 1000
THEN
l_error :=
l_error
|| '
|| 'Row '
|| i
|| ': Commission can not be higher '
|| ' than 2000 for department '
|| apex_application.g_f08 (i)
|| ' Employee: '
|| apex_application.g_f03 (i)
|| ' Requested value: '
|| apex_application.g_f07 (i);
return l_error;
END IF;
END LOOP;
END;I hope I could help you at least a little!
Good luck,
Seb
Edited by: skahlert on 07.10.2011 07:51

Similar Messages

  • How to set a default tabular form value?

    I am trying to set a default value for a tabular form.
    In Tabular Form Element:
    ========================
    Display as: Date Picker
    Formet: Date Picker (DD-MON-RR)
    Default Type: Item (application or page item name)
    Default P2_DATE
    My item P2_DATE is set as:
    ==========================
    Date Picker (DD-MON-RR)
    However when I try to add a row with a default date I get this error:
    report error:
    ORA-01790: expression must have same datatype as corresponding expression
    Any ideas?
    Regards,
    Pawel.

    Sorry for spamming but found a solution:
    which was to change the type into PL/SQL Expression like so:
    to_date(:P301_PROJECT_XFR_DATE,'DD/MM/YYYY')
    This is the format I used in P2_DATE...
    Regards.

  • Cannot Update Tabular form Values Error in mru internal routine: ORA-20001:

    i have created some master detail records through a manual tabular form. Iam getting the following error when i tried to updated the values through another inbuilt tabular form....
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "9067F4C5EF14529F831CB42B5567C288", item checksum = "07865E78639EB6477FB5DFB8B02EA047".,

    Hi
    Hopefully my response to your Error in mru internal routine: ORA-20001: no data found in tabular form thread will help. In this thread's example, there is no error message that displays the column names required, but the principle would be the same: Make sure that all fields drawn from the table are included as editable or hidden columns on the report (so that there is one instance of each field shown with a tick in the Edit column on the report's Report Attributes page).
    Andy

  • Tabular Form Values

    Hi everyone,
    I currently developed a tabular form to track time against activities. For each week my hours are submitted into the database. I currently have a multi row update that inserts my hours into the designated table. I would like to know how to keep my hours in the database but at the same time set my values on the screen to '0.0' when I re-click into my week. Can anyone help me with this issue?\
    Thanks
    Ryan

    Hello Tealord,
    >> I'm using Application Express 3.2.0.00.27. Due to existing applications the business will not upgrade at this time to 4.
    The behavior you describe, and the problems that go with it, is the standard behavior of pre-V4.0 versions. It was very neatly resolved in APEX 4.0 but according to your post, you can’t upgrade, although the reason is not clear to me.
    This is not a simple problem to solve. In my book, in the chapter dedicated to Tabular Forms, there is a description of a possible solution, and the demo application that accompanies the book includes a demo page of the solution. Unfortunately, this is not a simple (or short) solution so I can’t display it in the forum. If it’s important, you should gain access to the book.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • 1     Unable to retrieve the form values entered by the user from the xpath expression(with or without s

    1.1 Description of the Workflow
    We have designed a Workflow, which has an init form HighLevelQuestionnaire.
    1. The user attempts to start the workflow by submitting this form, which has an XML schema embedded.
    2. When user submits the data, we set workflow variables to fetch data from the init-form and all the values entered by the user are stored in the database.
    3. Based on the values, value of Risk Level is calculated to be either High or Medium, and user is routed to one of the two routes.
    4. The user QPAC is used to show the next form to the user.
    Another form has been designed called AssessRisk in which user is asked to confirm the Risk Level.
    5. At this point, we use Script QPAC to print the values in the log.
    1.2 Problem description
    1. In the Point No. 6 of the workflow, the values are not printed in the log. A blank space is printed instead.
    2. Initially, we embedded the schema in the form. But when values were not printed, we removed the schema. Even then it didnt work.
    1.2.1 User QPAC Specifications
    Properties of user QPAC used in Step 4 of the workflow
    Mappings Tab: -
    Input Variable --- No variable
    Template URL ----- Form11.xdp
    Output Variable ---- myform
    Myform is a form-variable, which has template URL as Form11.xdp
    1.2.2 Script QPAC
    1.2.2.1 With XML Schema embedded
    import com.adobe.workflow.pat.service.*;
    System.out.println("----------- High Level Questions -----------");
    System.out.println("--1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data/RiskLevel/general/Risk_Level") + " @@@@@");
    Note:- Here RiskLevel is the schema root of myform and Risk_Level is the schema variable mapped with textfield on the form
    1.2.2.2 Without XML Schema embedded
    System.out.println("--1.1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data/fields/Risk_Level") + " @@@@@");
    1.2.2.3 Conclusion
    In both the cases, a blank value is printed. In both the cases, we get some output which is when we use
    System.out.println("--1.1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data ") + " @@@@@");
    In this case all the values are printed with space in between.
    This is the basic feature which has to be used while developing workflows.

    Hi
    You might want to try using VariableLogger, at:
    http://www.avoka.com/avoka/qpac_library.shtml
    It's a little more reliable than the script QPAC, especially if one of your xpath expressions is wrong.
    Please note that embedding the schema makes no difference in how the data from the form is stored. What makes the difference is whether your fields are bound to specify schema elements, or whether they use the "normal" binding.
    Howard

  • How to refresh page after selecting value from LOV item , in a tabular form

    Hi ,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, couple of issues here.
    1.
    2nd item(column) in tabular form, that LoV should get populated based user's selection value in first item LoV. So how do i refer to the value, that user selected in first item's LoV? I will have to use this reference in LoV query of my 2nd item ( on this tabular form)
    2.
    How can we refresh the page, when user selectes value in first item ( from LoV). As this is a tabular form, here item type is Select List, we dont have an option to pick item type as Select List with Submit. So problem is that when user selects value for item 1, refresh does not happen and item 2 LoV does not get populated as per user's selection in item 1.
    Please help here. Would be really appreciated.
    Thanks and Regards,
    Rave.

    Thanks Ben and Dan for your responses.
    Ben, your solution helped me with refresh of page, as page got submitted.
    This answers to my 2nd question. However, I still need to know first question, which basically is, how do i refer to the value, that user selected in first item LoV.
    Issue is, I selected the value in first item LoV, it got submitted and page fot refreshed. But after page refresh, first item LoV loses its value that I had selected last time. It does not retain the selected value after refresh.
    I have an unconditional process, that on every submit(refresh) of page, I set my items with their corresponding values. But problem is what do i mention there to refer to this item.
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Any help here would be really appreciated. Please suggest how do we refer to this item's selected value.
    Thanks and Regards,
    Ravi.

  • Sum the values of a text field in a tabular form using JavaScript

    Hi Folks.
    OK, I put my hands up. I don't know Java script but I'm picking up the basics and I WANT to learn.
    Here's my situation.
    I have a tabular form which has lots of Standard Report Columns and ONE text field.
    I want to sum the values entered in the text field, real time, using Java Script without the need to have a round trip to the database.
    I'm guessing this will involve some kind of loop. Once I have that SUM figure I will store it in a hidden item and it will be used for validation when the user submits the form.
    If anyone can give me a simple Java Script to do this, or point me in the direction of one, I'd be very grateful.
    Many thanks.
    Dogfighter.

    Hi Arie.
    Thanks for the link.
    That's a great start,
    What I've got working so far is the following...
    <script type="text/javascript">
    function f_calculate_delta(p_this,p_rownum)
    var amt = $x(p_this).value;
    alert (amt);
    var display_item_to_set = 'f08_'+ p_rownum
    $x(display_item_to_set).innerHTML = amt
    </script>
    This is working fine.
    Where I'm stuck at the moment is how I can 'get' the value of another cell in the same row. They have all been set up using the APEX_ITEM API with their own unique IDs.
    I will continue looking but if you could give me a steer, that would be great.
    Many thanks
    Simon
    PS. APEX 3.1
    PPS. Trying to get the value of another row using...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $x(display_item_to_get).value
    PPPS. Also tried...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get)
    and
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get).value
    None of which are working at the moment.
    Message was edited by:
    Dogfighter

  • Populate select list when a date selected from date picker in tabular form

    Hi Guys,
    I have a situation where user picks a date from a date picker in tabular form.
    So as soon as he picks a date say 05/31/2011 from the date picker I want to populate a select list with 2 values : Tuesday AM , Tuesday PM.
    I have gone through the forums a lot and figured we can write a Dynamic Action using JQuery Selector. But I am not sure how to figure out the day from a date picker.
    I appreciate if some one can give your thoughts on how to proceed. It seems to be simple but looks like a tricky one. I am not familiar with writing Java Script.
    Thanks ,
    Raj

    I was thinking your date selected from CALENDAR ended in a list_item.
    I don't know I thinking that
    well,
    :master_block.itemdate is your text_item where calendar return date selected.
    and then , following Gerd's step
    Create a WHEN-MOUSE-DOUBLECLICK on the date-item of CALENDAR and write :
    begin
    :master_block.itemdate := calendar (.........);
    go_block ('master-block');
    execute_query;
    end;
    or set a global or parameter variable date selected from calendar :parameter. xxxxxx
    in a PRE-QUERY
    :master_block.itemdate := :parameter. xxxxxx
    and
    Create a WHEN-MOUSE-DOUBLECLICK on the date-item of CALENDAR and write :
    begin
    :parameter. xxxxxx := calendar( ....);
    go_block ('master-block');
    execute_query;
    end;
    regards

  • Date Picker in a Tabular Form

    Is there a way to use the minimum and maximum dates in date picker in a tabular form? It does not appear that this is available in a tabular form and I am finding it very difficult to come up with a way to limit the date selection to a particular month when using the tabular form. Any suggestions would be appreciated.

    I hadn't accounted for the addRow, and datepickers on newly added rows are indeed not restricted. Datepickers on existing rows are still being restricted, but since you had no rows there anymore you could only add rows.
    Could it be that in your local solution you have no rows too, and thus can only add rows, which has no date restriction?
    To restrict the datepicker for new rows I changed the "Add Row" button's URL. In 4.2 I'd set it to be defined by a dynamic action, but since you're on 4.0 I set the URL to:
    javascript:myAddRow();In the page edit i added this to "Javascript > Function and Global Variable Declaration"
    function myAddRow(){
    apex.widget.tabular.addRow();
    $("td[headers='DETAIL_DATE'] input:last")
    .datepicker("option","changeMonth",false)
    .datepicker("option","minDate",$v("P2_MASTER_MONTH_MINDATE"))
    .datepicker("option","maxDate",$v("P2_MASTER_MONTH_MAXDATE"));
    };This will first add a new row, and then the restriction will be applied to the last input item matching the selector. Indeed, on your local instance you will have to change the "apex.widget.tabular.addRow()" to just "addRow();", since the apex.widget.tabular namespace is new in 4.2.
    Some more notes of importance:
    - the column header: in the demo your column is "DETAIL_DATE". If this column is called differently in your local solution, you will need to change the jQuery selector to reflect this!
    - the P2_MASTER_MONTH_MIN/MAXDATE columns do some date arithmetic. It is important to take a look at their value if the datepicker is not being restricted, and also what language your application runs in. The default english application will set a date format for the jQuery datepicker to be dd-M-y, and it will take '01-JAN-2013' as a valid value. If your field however would contain something like '01/01/2013' it would not work. So for safety, take a look at the values of these items!

  • Dynamic Form in Tabular Form i.e SET VALUE

    Hi,
    I have an tabular form ,
    In which two column are there i.e username and department
    Just I wnt to know can dynamic action i.e SET VALUE CAN BE USED IN TABULAR FORM.
    AS I CHANGE THE USERNAME THERE PERSPECTIVE DEPARTMENT SHOULD CHANGE.
    can anyone help.

    Hello Trent,
    I too, am attempting to set the value of an item when another item is changed.
    I need to capture the APP_USER changing the row for each row changed in the tabular form when submitted.
    My table is in a remote database that is not allowed to have APEX loaded directly in the instance (or db link TO the APEX instance).
    Can’t get the APP_USER making the change at this level, as the APEX code is not there.
    The instance that hosts the APEX installation accesses the table via a view through a db link.
    Can’t use a trigger on the view to set the APP_USER using APEX functionality.
    Not desirable to re-invent the IUD wheel using instead-of triggers.
    The example you posted on http://apex.oracle.com/pls/apex/f?p=45448:11 is exactly what I need (even though your example sets the value on Lose Focus and I Set value on Change).
    I am attempting to implement the dynamic action for the item using your javascript, and am almost there....but not quite. The dynamic action is updating the target item in ALL the rows in the tabular form, not just the one that is being changed.
    This, I am sure, is due to my inexperience with Dynamic Actions, jquery syntax, and the javascript API’s for APEX. I believe I know what the issue IS, I’m just not sure how to work around it.
    Please note: I attempted to download your example at the above website (turning off popup blockers), but had no success (I got the thank-you for downloading message, but have no clue what was downloaded to where). I was hoping to compare your form Dynamic action with mine to see where I went wrong.
    If you could please, review the following and:
    1)     let me know what might be different from your working example?
    2)     provide info on how to get your working form downloaded (such a tease to have the download link there and not get it to work ;0} ) , please?
    The following shows the html from view source for a row in my tabular form. This will help you get an idea of the items. The actual number of rows in the form is about 50.
    <table cellpadding="0" border="0" cellspacing="0" summary="" class="report-standard">
    <tr class="highlight-row">
    <td headers="CHECK$01" class="data">
    <label for="f01_0002" class="hideMe508">CHECK$01</label>
    <input type="checkbox" name="f01" value="2" class="row-selector" id="f01_0002" />
    </td>
    <td headers="JOBNO_DISPLAY" class="data">X111Y2222</td>
    <td align="center" headers="DEPR" class="data">
    <label for="f03_0002" class="hideMe508">DEPR</label>
    <input type="checkbox" name="f03_NOSUBMIT" value="1" id="f03_0002_01"
    onClick="if (this.checked) {apex.jQuery('#f03_0002').val('1');}
    else {apex.jQuery('#f03_0002').val('');}" />
    <input type="hidden" name="f03" value="" id="f03_0002" /></span>
    </td>
    <td headers="UPDUSER" class="data">
    <label for="f04_0002" class="hideMe508">UPDUSER</label>
    <input type="text" name="f04" size="16" maxlength="2000"
    value="MOMSDAT" id="f04_0002" />
    </td>
    <td headers="DERIVED$01" class="data">MOMSDAT</td>
    <td headers="UPDDATE" class="data">13-DEC-11
    <label for="f02_0002" class="hideMe508">JOBNO</label>
    <input type="hidden" name="f02" value="X111Y2222" id="f02_0002" />
    <input type="hidden" id="fcs_0002" name="fcs"
    value="DB31F7B9ED99E6A2F7295F6B7D236409">
    <input type="hidden" id="frowid_0002" name="frowid"
    value="AAATI3AAGAAAAIXAAo" />
    <input type="hidden" id="fcud_0002" name="fcud" value="U" />
    </td>
    </tr>.....
    <tr>.....</tr>
    </table>
    To help explain:
    I have a checkbox associated with array name f03_NOSUBMIT,
    This checkbox OnClick updates a hidden item associated with array name f03. The hidden item is linked to the depr column of my view/table (this functionality is straight from Oracle’s tabular checkbox wizard – works great, no problems).
    When the check box is changed, I need to capture the APP_USER value in the UPDUSER field associated with the f04 array (nice that the array names matched up with your example :0} )
    To do so, I created a dynamic action:
    Name: Set_Upduser
    Sequence: 10 (it’s the only DA)
    Event: Change
    Select Type: jQuery Selector
    jQuery Selector: input[name=”f03_NOSUBMIT”]
    --note: the event does not fire if I use f03
    --since that value is not actually
    --changed until submit with this
    --method.
    Condition: - No condition –
    True Actions:
    Sequence: 10
    Action: Set Value
    Fire When Event Result is: True
    Fire On page Load: Unchecked
    Stop Execution On Error: Checked
    Set Type: JavaScript Expression
    JavaScript Expression:
    var row = $x_UpTill(this.triggeringElement, 'TR');
    var otherElement = $('input[name="f04"]',row)[0];
    otherElement.value = '&APP_USER.';
    Selection type: jQuery Selector
    jQuery Selector: input[name="f04"]
    This ALMOST works...
    When I run the page and click on just one check box, the UPDUSER fields are updated with the APP_USER for ALL the records, not just the row for the checkbox I clicked. And, if I submit the changes, ALL the records in the table now have the APP_USER in the UPDUSER column. Not just the column where the check box was changed (Which would be expected since all the values are changed in the form – hey, the submit part works :0} ).
    Your example at http://apex.oracle.com/pls/apex/f?p=45448:11 works, setting the value for the target field only for that row. If I can get mine to work the same way, I will be good to go (as in hog-heaven, doing the Snoopy Supper-Time dance).
    I am thinking my issue is with the row identification in the
    --- var otherElement = $('input[name="f04"]',row)[0];
    I seem to not be picking up the row value in the row var.
    Am I reading line correctly where 'input[name="f04"]' is pNd, and row is pValue? Read the description of the $x_UpTill API, not sure how this is working to identify pValue (Row?).
    Additionally, I am not sure what the [0] is for at the end of the otherElement var definition. I don’t see that listed with the $ JavaScript API parameters (Google wasn't much help there either).
    OR, am I missing something else?
    Once again, if you could:
    1) let me know what might be different from your working example? (What does yours have that mine doesn’t)
    2) Provide any info on how to get your working form downloaded at http://apex.oracle.com/pls/apex/f?p=45448:11. Please, please?
    As always, your assistance is greatly appreciated!
    Edited by: amckinne on Dec 27, 2011 5:29 PM
    Edited by: amckinne on Dec 27, 2011 5:33 PM

  • Tabular Form Read Only Date Picker

    Hello,
    I have two or three Items with date pickers and do not want to implement
    this code because it will be too many buttons on my form. I need to clear one item
    at a time when the datepicker is readonly but, in a tabular form.
    function f_clear_items()
        {$x('P1_ITEMA').value = ''};
        {$x('P1_ITEMB').value = ''};
        }Then once I create a url button and pass this function I can clear the datepicker's. But, I
    was wondering is there a cleaner way to this.
    I have other items on the page that are named the same but, in different tables. I only want
    to clear each date picker item at a time. This code works fine for a regular form.
    -Element Post Element Text for the Item to Clear
    a href="javascript:setValue('P1_ITEMA','');">Clear Date</aThere is a thread named 'How to clear a read only page Item...?' that states how this code works but, does not
    work for a tabular form in a Master Detail page. There is a link on side the Date Picker to clear item specified but, in a tabular form Item, there is no Element tab, any ideas on how to clear a readonly date picker item using a tabular form
    and not using a button for each item, thanks in advance. I am using Application Express 3.2.0.00.27.

    Dan,
    I totally understand your point of view. So, this tabular form aspect was not tested once the Clear Date link was discovered to clear a Read Only date field. Yes, using a button to clear a date is great but, I do not want to clear every date or specified item with the click of one button for this application. It is very useful but, not for my needs at the moment.
    Basically, if a date is selected and it needs to be cleared out you can just delete the value. But, if the date is readonly you can not clear/delete the date value unless you have the Clearing functionality for a particular item using the datepicker. It may not be worth the trouble Dan like you state by adding this extra code to the calender. If an invalid date is entered an error will appear anyway.
    Thanks alot Dan for expanding my mind and showing me some JQuery and providing me with this link to do some further research if needed, thanks again.

  • Unable to pass a parameter to a field in a tabular form.

    I created a tabular form with 2.0 using the wizard. I’m having issues though with 2 of my columns.
    The two columns are last_edit_user and last_edit_date. As you can tell I’m trying to pass the system date and :app_user to these two fields.
    I read this thread Default Value in Tabular Form and decided to create a simple function on the database that returns the system date. Then under report attributes I went to the last_edit_date column. In “Tabular Form Element” I changed it to “Display as Text (saves state)” made the default type a PL/SQL expression or function then put the function name in the ‘default’ text field.
    When I try to update a field I then get:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01407: cannot update
    I have also tried creating a computation and passing the date to a hidden item then use default type item and list the hidden item in the default text box. I get the same error.
    Considering how often these fields or similar would come up in a tabular form I can’t help but think there must be an easy way of passing parameters to fields in a tabular form without making them editable.
    Message was edited by:
    [email protected]

    This keeps coming up often and I find that the easiest way to handle this is in a row-level trigger on the underlying table
    create or replace trigger t
    before insert or update on mytable
    for each row
    begin
    :new.last_update_date := sysdate;
    :new.last_update_user := nvl(v('APP_USER'),user);
    end;
    /

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example in the following link -
    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606::NO:::
    Basically, I want to use the drop down list to populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done on this page:
    1. Create an Application Process On Demand - Set_Multi_Items_Tabular2:
    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
      OWA_UTIL.mime_header ('text/xml', FALSE);
      HTP.p ('Cache-Control: no-cache');
      HTP.p ('Pragma: no-cache');
      OWA_UTIL.http_header_close;
      HTP.prn ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    2. Create two application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following in the Page Header:
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);   
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
        get = null;
    </script>
    Add the follwing to the end of the above JavaScript:
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    var s = filter.id;
    var item = s.substring(3,8);
    var field2 = list2 + item;
    f_set_multi_items_tabular2(filter, field2);
    4. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

Maybe you are looking for

  • Calling a method in ABAP OO via -

    Hi, I've seen that there are two ways to call a method (correct me if I'm wrong): the first is by using CALL METHOD the second is by using object->method( ) Whenever possible (ie. the parameters are only of Returning and Importing type) I prefer the

  • [Solved] headless server suggestions

    Hi everybody... more of a archlinux user poll. I'm running a server previously centos / debian... now arch64 which it purrrrsssss happily with. I got all my samba torrent stuff figured out. Now I want to make this thing headless. I've heard that free

  • Sync of Zencast items INCREDIBLY s

    I just upgraded from a Zen V Plus to the Zen. On the V Plus, I occassionally used Zencast (video casts) and aside from memory issues the process worked ok. I subscribed with Zencast, updated channels, and then converted and downloaded in Sync Manager

  • Acrobat Professional 8.1 interface problem with Internet Explorer

    After upgrading to the latest version of Internet Explorer, I cannot open or download Adobe files from online sources.  The Adobe Acrobat program simply shuts down, and the following error message appears:  "A serious error has been detected and Adob

  • ITunes keeps trying to download nonexistent file from Store, reports as "Corrupted"

    iTunes Match mis-matched one of my songs. It turns out it's from an album no longer carried in the iTunes Store. Through Customer Service, I obtained a credit to re-purchase the song from a different album. This was months ago. There hasn't been a pr