Help using a dynamic action to update tabular form items (specifically radio button) based on collection

Hi Everyone, I have posted this question in the past and made huge progress with Denes Kubicek's help:  https://apex.oracle.com/pls/apex/f?p=31517:294:115851992029365::::: based on my earlier question posted: https://forums.oracle.com/forums/thread.jspa?threadID=2537494
I am struggling with one item in my tabular form.  It is a radio button.  The choices all appear properly, but the value is not saved in the collection (and hence, not saved in the table).  All other items in the tabular form save properly.
here is what I have for the query.   It is item c024 (which maps to ;'f03'), which is defined as a radio LOV based on an existing LOV.
Currently I have:
2 page items:
P110_ID
P110_VALUE
Dynamic action called CHANGE COLUMN:
event: CHANGE
selection type: jQUERY Selector
jQuery:
jQuery Select = input[name='f03'],select[name'f08'],select[name='f09'],input[name='f10'],input[name='f11'],input[name='f12'],select[name='f40'],input[name='f21'],input[name='f22'],input[name='f23'],input[name='f50']
event scope: Dynamic
true action#1: set value P110_ID javascript expression this.triggeringElement.id
true action#2: set value P110_VALUE javascript expression this.triggeringElement.value
true action#3: execute pl/sql code
declare
  v_member number;
  v_seq number;
begin
  v_member := TO_NUMBER (SUBSTR (:p110_id, 2, 2));
  select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
  safis_collections.update_column(v_seq,
                                v_member,
                                :p110_value);
true ation#4 refresh region :LANDINGS_COLLECTION
the tabular form is based on the query:
SELECT
apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
seq_id,
seq_id display_seq_id,
apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0','  -- Select Favorite --  ','f08_'||seq_id,'') Disposition,
apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear,
apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars,
decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished,
decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY,
decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT,
c024 hms_flag,
decode(c050,'Y',apex_item.checkbox(21,'Y','id="f21_'||seq_id||'" style="background-color:#FBEC5D; " onClick="alterYes('||seq_id||');" onKeyPress="alterYes('||seq_id||');"',c021),'N','N/A') FinsAttached,
decode(c050,'Y',apex_item.checkbox(22,'N','id="f22_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterNo('||seq_id||');" onKeyPress="alterNo('||seq_id||');"',c022),'N','N/A') FinsNotAttached,
decode(c050,'Y',apex_item.checkbox(23,'U','id="f23_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterUnk('||seq_id||');" onKeyPress="alterUnk('||seq_id||');"',c023),'N','N/A') FinsUnknown,
decode(c050,'Y',apex_item.textarea(28,c028,3,null,null,'f28_'||seq_id,''),'N','N/A') Explanation,
decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale,
decode(c020,'Y',
apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;"',null,null,null,'f40_'||seq_id,''),
'N','N/A') HMS_AREA_CODE,
c020,c050,
decode(c020,'Y',
apex_item.text(41,TO_NUMBER(c041),5,null,null,'f41_'||seq_id,''),
'N','N/A') Sale_Price
from apex_collections
where collection_name = 'SPECIES_COLLECTION' order by seq_id
I have noticed the following:
when I change column C011 (price) the following values are set in the dynamic action:
P110_ID = f11_1
P110_VALUE = whatever I change the price to.
when I change the column C024 (hms_flag), the following values are set:
P110_ID = f03_0001
P110_VALUE = whatever I change hms_flag to.
the region is refreshed in my dynamic action, and the change for hms_flag does not hold.  I have tested the SQL query that generates the value for v_SEQ in the dynamic action.   In both a change to price and HMS_FLAG it appears valid
select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
if f11_1, v_seq:= 1
if f03_0001, v_seq := 1
thank you!

solved.  sort of. 
field c024 references f03.
the Dynamic ACtion, step 4 calculates v_member by taking a substring of P110_ID...and in all other fields, the column and the field (fxx) are the same value....except for c024.
I am not certain exactly how to resolve, but see the problem.

Similar Messages

  • Dynamic Action On change tabular form question

    Hi guys!
    I've wanted to add dynamic action on change (tabular form) to execute PL/SQL which checks if column of the tabular form has changed and if yes it changes walue of text field to Y or N. It doesnt work...and I don't know why. If I create validation with this PL/SQL it works. Can you help?
    DA:
    On change - Tabular Form
    PL/SQL;
    DECLARE
       nazwa     VARCHAR2(4000);
       counter   NUMBER := 0;
    BEGIN
       FOR i IN 1 .. apex_application.g_f08.COUNT
       LOOP
        SELECT NAZWISKO INTO nazwa FROM SPR_META.M_UZYTKOWNICY WHERE NAZWA_UZYTKOWNIKA = apex_application.g_f02(i);
          IF wwv_flow_item.md5(nazwa) <>  wwv_flow_item.md5(apex_application.g_f08(i)) THEN
            counter := counter + 1;
          END IF;
       END LOOP;
       IF counter > 0 THEN
       :P5_IS_TABULAR_FORM_CHANGED := 'Y';
       ELSE
        :P5_IS_TABULAR_FORM_CHANGED := 'N';
      END IF;
    END;Page items to submit: P5_IS_TABULAR_FORM_CHANGE
    What's wrong?
    With regards,
    PsmakR

    Region static id shouldn be in bracketsYou missed the '#' informt of the region id.
    why my original PL/SQL process did not work
    FOR i IN 1 .. apex_application.g_f08.COUNTThis works only when the application array has values and that happens only when the page is submitted.When you submit the dynamic action , it isn't.
    This script combined with script to detect changes makes apex page running very slowIf you use that PLSQL code(assuming it works as expected) , then its going to take a server request every-time you change a field in the tabular form and loop though all the array values(if they would be submitted before) and recalculate and compare the checksums . Isn't that going to be very inefficient.
    As for that JS code, it only runs at the client side. You can do all the server side checks on submit, when the user expects some delay due to processing.

  • Dynamic Actions on tabular form items

    Has anyone had success with using dynamic actions on a tabular form item?
    When I create a dynamic action for the selection type I believe I want to use DOM Object, I am just not sure what ID I then need to put into the DOM Object field.
    Any help would be greatly appreciated
    Regards
    Mark

    If you wish to use JavaScript with tabular forms, I suggest looking at APEX_ITEM column types. They allow you to specify the JavaScript array number of any given column in your tabular form and rely on it. Then as you loop through your rows you can positively identify the element.
    Example:
    Original query:
    select colA, colB from myTable;
    select apex_item.text(1, colA, 20,20) as myText,
      apex_item.select_list_from_lov(2, colB, 'LOV_MYLOV', 0, 'NO') myLookup
      from myTable;I also highly recommend Firebug for Firefox. It will allow you to drill down into the DOM on any page to see the element identifications as the browser sees them. Definitely the best browser plugin for web development.

  • Dynamic Action, validation check, on an Item, could not use Change event

    I am learning how to use Dynamic Actions in a 3.2.x app that was upgraded to 4.0.x. I wanted to share what I learned adding client side validation with these actions. Perhaps an Apex guru could suggest an easier method to use this feature.
    I have an existing function where a user selects multiple rows in a report page, and then assigns a single status and enters justification text for the selected rows in another page, then saves changes (via submit).
    One item, justification, is required. I replaced my JavaScript validation of an empty value, e.g., P10_JUSTIFICATION.value, with a dynamic action. The Change event was a candidate for this item, with the "is not null" Condition. However, it is possible to initiate this screen to review the status, overlook the justification text and immediately select a button to save changes. No Change event has fired. The Before Page Submit event was applicable here. This Event selection in the wizard does not provide the Item for definition and then the Condition wasn't the right context though available for selection. I selected JavaScript expression for the Condition, actually entered my original JS test expression, and created one True Action. The True action displays an Alert to tell the user that required text is missing.
    Test of this DA was not completely successful. The alert appeared but the page went on to submit anyway. I found I had to add another True Action, Cancel Event, to stop the submit. The DA was then successful.
    The Apex site examples, [http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm] , do a great job showing use of Change and Set Value events for Items but a user may not always navigate through items. These features were promoted for developers with no to little knowledge of JavaScript to use Apex for application development. This DA required using/understanding JS anyways.
    My next step is to implement actions on a tabular form that that has required values. It is disconcerting that I have read in the forum that the column value references such as f0x and its row number are required to get it all working (as a DOM or JQuery selector). I have already found that tabular form columns can be re-ordered from v3.2.1 to 4.0.x. I was hoping I could declare dynamic actions or simpler Javascript methods that would not rely on f0x array references.
    Thanks,
    Kelly

    It is disconcerting that I have read in the forum that the column value references such as f0x and its row number are required to get it all working (as a DOM or JQuery selector).Not necessarily. One possibility is to use descendent jQuery selectors to attach the dynamic action event handler by column heading:
    td[headers="HIREDATE"] input

  • Set checkbox session state using Jquery / dynamic action

    Hello Folks,
    I'm trying a simple dynamic action to disable & set element value upon making a radio box selection.
    What I'd like is:
    a) if i chose "Vendor" as "Traditional" (default value) I would like to set the "SNAP" flag as Checked and "Status" textbox to "test for static value" (SNAP flag is not set, only works on Page load)
    b) if i chose "vendor" as "Isilon" then "SNAP" flag should be greyed out (disabled) and "Status" textbox should be disabled. (Working as Expected)
    Link to the page:
    http://apex.oracle.com/pls/apex/f?p=73069:6:0::NO:::
    Workspace: wksp_chandu
    Username: test
    Password:test
    Dynamic Action
    Identification
    Page:
    6. Check Disable radio
    *Name(Value Required)
    *Sequence(Value Required)
    When
    *Event(Value Required)
    - Select Event -
    Change
    Click
    Double Click
    Get Focus
    Key Down
    Key Press
    Key Release
    Lose Focus
    Mouse Button Press
    Mouse Button Release
    Mouse Enter
    Mouse Leave
    Mouse Move  Page Load
    Page Unload
    Resize
    Resource Load
    Scroll   Select          
    After Refresh
    Before Page Submit
    Before Refresh
    Change Order [Shuttle]
    Custom
    Show unsupported...
    *Selection Type(Value Required)
    - Select Selection Type -
    Item(s)
    Button
    Region
    DOM Object
    jQuery Selector
    *Item(s)(Value Required)
    Condition
    - No Condition -
    equal to
    not equal to
    greater than
    greater than or equal to
    less than
    less than or equal to
    is null
    is not null
    in list
    not in list
    JavaScript expression
    *Value(Value Required)
    True Actions
    The following actions will be fired when the 'When' condition is met, or when it is 'No Condition'.
    Edit
    Sequence
    Action
    Fire On Page Load
    Selection Type
    Affected Elements
    10
    Clear
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    20
    Disable
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    Add True Action
    False Actions
    The following actions will be fired when the 'When' condition is not met.
    Edit
    Sequence
    Action
    Fire On Page Load
    Selection Type
    Affected Elements
    10
    Enable
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    30
    Set Value
    Yes
    Item(s)
    P6_STATUS
    40
    Execute JavaScript Code
    No
    Item(s)
    P6_SNAP
    Add False Action
    Thanks!
    Chandu

    Oops...I just got it working.. Thanks for your time. I was trying to set checkbox value via javascript code and somehow that wasn't working...Finally changed the setvalue to be based on "PL SQL expression" nvl(:P6_SNAP,1)...that seem to have worked.
    Thanks again !

  • Dynamic LOV in a Tabular Form

    Can somebody please tell me if there is a easy way to code a
    dynamic LOV in a Tabular Form?
    I need the ability to access a column value in the table row, to use in the WHERE clause of LOV query for another column in the row? Seems
    like that should be easy , but not finding an answer.
    Thanks for any help.
    Carol

    Hi Carol,
    You can add the select list's definition directly into your SQL statement using APEX_ITEM.SELECT_LIST_FROM_QUERY - see: [http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDIDGDA]
    If you first run your page with your existing select list on it, then do a View Source and look for the select list, you will see a "name" attribute of something like "f01" or "f02" etc. Make a note of the number part of this.
    Then update your SQL statement to include the above and using the number you noted as the Index value (say, 4):
    SELECT EMPNO,
    ENAME,
    DEPTNO,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(4,MGR,'SELECT ENAME d, EMPNO r FROM EMP WHERE DEPTNO = ' || DEPTNO || ' AND EMPNO &lt;&gt; ' || EMPNO) MGR
    FROM EMPThat would give you a select list of employees in the same department as the current employee (excluding that employee themself)
    Andy

  • Is there a way to enable/disable a tabular form item based on the value of a second item?

    Hi Everyone,
    I have a tabular form based on a collection.   The column c050(maps to f30) will be either Y/N.  If it is Y, then I would like to enable column c024( maps to f24) (which happens to be a radio button based on lov).  If the value of c050 = N, then disable c024.   There are potentially many rows, and the item c024 would only be enable/disabled for the specific row.   So if row 1 has c050=Y and row 2 has C050=N then row 1 c024 is enabled, and row 2 c024 is disabled.  Hope that makes sense.
    I have created a dynamic action called enable/disable HMS fields.
    event=CHANGE
    selection type = jquery selector
    jquery selector = input[name='f30']
    condition EQUAL TO
    value Y
    true action1 - enable, jquery selector, input[name='f24']
    true action 2 - alert, You have added an HMS Species.   There may be additional data to enter.  thanks
    false action1 - disable jquery selector, input[name='f24']
    false action2 - alert, no hms worries.
    The alerts in both cases show properly...but nothing seems to happen to f24.....what am I doing wrong?
    thanks

    Agh! This is the first time you mention this is a radio button!  That changes things a lot! As you can see, the format is different (f24_0001_0001) than what we have discussed (f24_0001).
    Radio buttons have their own quirks.  My bad, I should have asked what you had.  But since you said your original selectors on input were working I just thought these were text fields or something like that.
    How about you change it to a drop down list just so that you can see all work?  And fully understand it.
    Then you can work out the radio button option.
    If that doesn't get you there... I'm going to ask you setup an example in apex.oracle.com and give me credentials to log in and take a look.
    I could re-try the js on my side with a radio but it will take some time.
    So just to be clear... f30 is a drop down and f24 is a radio?
    See, this line:
    $x_disableItem("f24_" + row, true);
    Is NEVER going to find the radio buttons because it's missing the 3rd 0001 and 0002 (how many options do you have?)
    So perhaps you try it like this:
    $x_disableItem("f24_" + row + '_0001', true);
    $x_disableItem("f24_" + row + '_0002', true);
    ... keep going for the options...
    Do the same for the false of course.
    But I think this needs a better approach if you'll have radio buttons.  I just need to work it out.
    Ok, go try things...
    Thanks
    -Jorge

  • How to fetch the value of tabular form item in javascript

    Hello all
    I want to do some calculations on the value entered by the user in the textfield of a tabular form, how can I fetch the value of tabular form item in the javascript?
    I am using normal tabular form, not using apex_item tabular form.
    I can pass the current textfield value to the function using "this" as a parameter, but how can I fetch the value of other rows of that same column?
    Thanks
    Tauceef

    Hi Alistair
    jQuery is still not working, but I got it done through some other means, this is the code:
    function total(pThis){
    var l_Row = html_CascadeUpTill(pThis,'TR');
    var l_Table = l_Row.parentNode;
    var l_Row_next = l_Row;
    var n_rows = l_Table.rows;
    var lInputs;
    var v1;
    var sum = 0.0;
    var temp;
    var i = 0;
    var j = 0;
    //alert(n_rows.length);
    while(j < (n_rows.length - 1))
    temp = 0;
    if(l_Row_next != null){
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    //alert(v1);
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    temp = 1;
    if(temp == 0){
    l_Row_next = l_Table.getElementsByTagName('TR')[1];
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    j= j+1;
    $x('P78_TOTAL').value= parseFloat(sum);
    I am calling this function onblur event of the textfield.
    Still I am having one problem, I want to perform this calculation on load of the page also, how can I do that? because while calling onblur of the textfield I can pass that textfield to this function but on onLoad how I will pass the textfield to call this function so that I will be able to get the textfield value in the function?
    there may be some rows already existing, so I want the total of the existing rows to be displayed in my P78_TOTAL textfield that is why I need to do this calculation on onLoad of the page.
    Thanks
    Tauceef
    Edited by: Tauceef on Jul 8, 2010 4:57 AM

  • I made a fillable form using indesign and then acrobat professional but need to have radio buttons trigger different fields showing in the form below them - is that possible and if so how do I do it??

    I made a fillable form using indesign and then acrobat professional but need to have radio buttons trigger different fields showing in the form below them - is that possible and if so how do I do it??

    What version of Reader are they using, exactly? And are you sure they're
    using Reader itself and not opening the file inside a browser window, for
    example?
    On Fri, Feb 6, 2015 at 5:24 PM, jessicao96457206 <[email protected]>

  • Triggering Dynamic actions when updating an Infotype using a FM

    Hi all,
    This is the scenario.
    I am trying to run a Transfer action, (80), which updates the Infotype 0000 and Infotype 0001. When the entry in the Infotype 0001 is saved, a dynamic action is triggered and a custom infotype is updated automatically. I need to find a FM that takes care of any dynamic actins associated to an Infotype.
    I tried using a BDC, but I was not successful. While using the FM HR_INFOTYPE_OPERATION, I am able to update the data into the infotyes 0000 and 0001 but the dnamic action is not triggered. Can someone please suggest a solution.
    Thanks,
    Amar

    Hi,
       Thanks for you r reply. Well I am new to dynamic actions, but this is the Dynamic action that has been written.
    GET_DU(ZHRDUDYNCALL)
    COP,9009,,,(P0001-BEGDA),(P0001-ENDDA)/D
    ----P9009-SEQNR=P0001-SEQNR ---***
    P9009-AEDTM=P0001-AEDTM
    P9009-UNAME=P0001-UNAME
    P9009-DU_CD=RP50D-FIELD1
    --END OF ENTRY IN TABLE PA9009--
    --CREATE ENTRY IN TABLE PA9009----
    SY-DATUM=SY-DATUM
    GET_DU(ZHRDUDYNCALL)
    DEL,9009,,,(P0001-BEGDA),(P0001-ENDDA)/D
    P9009-DU_CD=RP50D-FIELD1
    --END OF ENTRY IN TABLE PA9009--
    The FM that I am using goes like this:
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty                  =  '0001'
        number                 =  lv_pernr
      SUBTYPE                =   wa_0000-MASSN
      OBJECTID               =
      LOCKINDICATOR          =
       VALIDITYEND            = lc_endda
       VALIDITYBEGIN          = wa_source_data-begda
      RECORDNUMBER           = 1
        record                 =  wa_0001
        operation              = 'COP'
       TCLAS                  = 'A'
       DIALOG_MODE            = '0'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
       SECONDARY_RECORD       = proposed_values0001
    IMPORTING
      RETURN                 = return
      KEY                    =
    Please let me know if there is anything more I need to do?
    Thanks,
    Amar

  • Using Dynamic actions while updating a Transfer action

    Hi all,
        I am trying to run a Transfer action, (80), which updates the Infotype 0000 and Infotype 0001. When the entry in the Infotype 0001 is saved, a dynamic action is triggered and a custom infotype is updated automatically. I need to find a FM that takes care of any dynamic actins associated to an Infotype.
       I tried using a BDC, but it was not successful. While using the FM HR_INFOTYPE_OPERATION, I somehow am not able to store the data into the Infotypes, leave alone the dynamic action. Can someone please suggest a solution.
    Thanks,
    Amar

    Hi VK,
        The dynamic action is:
         06     993     F     GET_DU(ZHRDUDYNCALL)
         06     994     I     COP,9009,,,(P0001-BEGDA),(P0001-ENDDA)/D
         06     995     C     ----P9009-SEQNR=P0001-SEQNR ---***
         06     996     W     P9009-AEDTM=P0001-AEDTM
         06     997     W     P9009-UNAME=P0001-UNAME
         06     998     W     P9009-DU_CD=RP50D-FIELD1
         06     999     C     --END OF ENTRY IN TABLE PA9009--
         08     891     C     --CREATE ENTRY IN TABLE PA9009----
         08     892     P     SY-DATUM=SY-DATUM
         08     893     C     GET_DU(ZHRDUDYNCALL)
         08     894     I     DEL,9009,,,(P0001-BEGDA),(P0001-ENDDA)/D
         08     895     C     P9009-DU_CD=RP50D-FIELD1
         08     896     C     --END OF ENTRY IN TABLE PA9009--
    Thanks,
    Amar
    Edited by: Amarpreet Singh Reen on May 4, 2009 3:54 PM

  • Dynamic Update Tabular form

    I have a tabular form on Table 1 (an empty table)
    I want to populate Table_1/tabular form with Table 2 values
    Table_1 & Table_2 are linked by pk/fk relationship (Main_Route)
    Basically, There will be a select list for Main_routes on the Table_1/tabular form. Once I hit the Apply changes button, I want it to get the values for street, ward, & section from Table_2.
    How do I achieve this? Is there some kind of trigger I can use, page process, or item-level sql?
    Table_1
    ID (number) (pk)
    Main_Route (varchar 2(30))
    Street (varchar 2(30))
    Ward (varchar 2(30))
    Section (varchar 2(30))
    Table_2
    Main_Route (varchar 2(30)) (pk)
    Street (varchar 2(30))
    Ward (varchar 2(30))
    Section (varchar 2(30))

    Hi,
    Go to SQL Workshop, SQL Commands and then run this:
    CREATE OR REPLACE TRIGGER  "TABLE1_BI"
    BEFORE
    INSERT OR UPDATE ON "TABLE1"
    FOR EACH ROW
    BEGIN
      DECLARE
        vSTREET VARCHAR2(30);
        vWARD VARCHAR2(30);
        vSECTION VARCHAR2(30);
      BEGIN
        IF :NEW.MAIN_ROUTE IS NOT NULL THEN
          SELECT STREET, WARD, SECTION
          INTO vSTREET, vWARD, vSECTION
          FROM TABLE2
          WHERE MAIN_ROUTE = :NEW.MAIN_ROUTE;
          :NEW.STREET := vSTREET;
          :NEW.WARD := vWARD;
          :NEW.SECTION := vSECTION;
        ELSE
          :NEW.STREET := NULL;
          :NEW.WARD := NULL;
          :NEW.SECTION := NULL;
        END IF;
      END;
    END;followed by:
    ALTER TRIGGER "TABLE1_BI" ENABLEThis should run on TABLE1 for any insert or update. As long as ROUTE_MAIN has a value, then the related information is retrieved from TABLE2 and used to update the record on TABLE1. If ROUTE_MAIN is empty, then the other fields are emptied as well.
    Andy

  • Dynamic action to update IT41

    Hello people,
    I want to update IT 41 after executing personnel action.
    I have written the dynamic action however it is not updating. can u advise?
    0000    04  991             P    T001P-MOLGA='99'
    0000    04  992             P     P0000-MASSN='Z4'
    0000    04  993             I      INS,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D
    0000    04  994            W     P0041-DAR01='01'
    0000    04  995            W     P0041-DAT01=P0000-BEGDA

    I did checked ur Dynamic Action but it looks Ok but still i made some changes kindly try this and update me
    0000 06 990 *   Update Infotype 0041*
    0000 06 991 P T001P-MOLGA='99'
    0000 06 992 P P0000-MASSN='Z4'
    0000 06 993 I INS,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D
    0000 06 994 W P0041-DAR01='01'
    0000 06 995 W P0041-DAT01=P0000-BEGDA
    I assume that from the above Z4 is Hiring action and 01 is Date Type.
    Best Regards,

  • Urgent help on a dynamic action

    Hi,
    I am working on SAP 4.6C and have an issue with a dynamic action. I started having this problem since a month. We did not customize this new dynamic action. I dont understand how it entered in my SAP R/3 system.Support packs were added last month can they be responsible.I am entering the discription of the dynamic action.
    0041 04 1 * --- BEI NEUANLAGE/EINTRITT IT2006 MIT 10 VORSCHLAGEN ---
    0041 04 3 I INS,2006,10,,(P0041-BEGDA),
    0041 04 4 W P2006-ENDDA=P0041-BEGDA
    0041 04 5 W P2006-ENDDA+4(4)='1231'.
    I did compare the table T588Z with the T-Code SCMP and can see that above dynamic action is newly added but need to know how.
    ASAP help would be appreciated.
    Thanks and Regards
    Swati.

    .

  • 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

  • Do I need a  separate volume.

    My question, do you need a separate volume for Time Machine. or can data reside on the same volume as the backup.

  • I am going to update my iOS from 10.6.8 to Mountain Lion. What problems will I face with third party applications? Alberto

    I am going to update my iOS from 10.6.8 to Mountain Lion. What problems will I face with third party applications? Alberto

  • InDesign Edit Original

    Hi Im a photographer and use InDesign creating wedding albums which involve continually editing graphic (tiff and jpeg). I use the function, Edit Original, by right click and selecting from the popup menu. As of last night the option doesnt appear, a

  • Availability Check in planned order

    Hi Everyone, What is differecnce between MDVP  collective ATP check and MD12 ATP. I am getting different result for the same planned order. could you plase tell me why this so. Thanks Siddhesh

  • Syndicator mapping

    I will brief the Current Scenario. My requirement is that I want to create the IDOC(MATMAS05) to create the Material master in SAP R3 with the help of SAP MDM, SAP XI. I have loaded the Data in SAP MDM. I have three table , Table “C” Inventory Maste