APEX Dynamic Actions?

Hello i'm trying to figure how how to have a dynamic action populate text fields.
When the create button is hit, it will insert the record in the DB like normal.
I had a search box doing a dynamic action when a record_number is entered and the selection changes
It populates the remaining text boxes with the results of the record_number.
I used a "SET_VALUE" true action on each individual ITEM
For each individual item i have different SQL Statement populating that item.
Ex. To populate Last_Name/ P2_LAST_NAME item i do the following
Select LAST_NAME from patient_Demographics
where record_id = :P2_RECORD_ID
Affected Elements:
P2_LAST_NAME
So i have about 8 of these true statements, so i'm hitting the DB 8 times to get the individual items.
Is there a way to hit the DB once and set the items using one PL/SQL statement?
I tried using a PL/sql function body, i'll admit, it didnt know what i was doing, it didnt work

Hi,
So as you've found out, support for setting multiple affected elements in 4.0 is very limited. Are you definitely trying this out on 4.0? The reason I ask, is because we only introduced the 'Page Items to Return' attribute in 4.1.
In 4.0, I would suggest falling back to a combination of a dynamic action, some JavaScript and a page level AJAX callback, as described here:
Dynamic Action - setting the the value of multiple Affected Elements
I think this should work better for you than trying to manipulate the 'Execute PL/SQL Code' action in 4.0 to do this.
Hope that helps.
Anthony.

Similar Messages

  • APEX dynamic action - How to hide an item after the page loads

    Hello
    I have a form  with  item  Type,  lesson and page.   I want to create a  dynamic action like "on page load" if Type = x then don't show lesson and page items. .
    How do I say if Type=x then  don't show lesson and page. otherwise show them.
    Please note Dynamic action,  Event=Page load
    Thanks

    create dynamic action like
    Event:Change
    Selection Type:Item
    Item:Type
    Condition:Equal To
    value:X
    Select Action:Hide
    Select Items to hide
    also create opposite false action
    and click on page checkbox below action to yes
    Hope this may helps
    pars.

  • Trying to use Dynamic Action with button - no #BUTTON_ID#

    I saw this post: Issue with apex  dynamic action
    and I'm having exactly the same issue. I'm using the Blue and Tan Theme and the button's "normal template" looks like the following:
    <table class="t2Button" cellspacing="0" cellpadding="0" border="0"  summary="">
    <tr>
    <td class="t2L"><a href="#LINK#"><img src="#IMAGE_PREFIX#themes/theme_2/button_left.gif" alt="" /></a></td>
    <td class="t2C"><a href="#LINK#">#LABEL#</a></td>
    <td class="t2R"><a href="#LINK#"><img src="#IMAGE_PREFIX#themes/theme_2/button_right.gif" alt="" /></a></td>
    </tr>
    </table>Can someone help me get the #BUTTON_ID# tag in the correct spot?
    (PS. This application was originally built using APEX 3.2 and upgraded to 4.1. Don't know if that matters or not.)

    The button calls a procedure which can take several minutes to complete. It calculates and stores values for display. I'd like to open up a modal window so that the user has more concrete feedback that the calculation process is underway. I'd also like to tie it to the refresh of a particular region on the page that shows a list of the stored calculations.

  • Dynamic Action in APEX 3.1.2

    Hi All,
    I am trying to achieve dynamic action in apex 3.1.2 without refreshing the page. I have 2 pages, In page 1 I am opening page 2 which returns an html text to an hidden value which is working fine up to this part. I am trying to show the return html tag using display item. So I am trying achieve this using following code, but is not working please help me.
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    <script type = "text/javascript" >
    function refreshdata()
    {  var tmp = new htmldb_Get();
    tmp.add('P123_DISPLAY_HTML'', $v('P123_DISPLAY_HTML''));
    tmp.get();
    $('#DISPLAY_HTML').trigger('apexrefresh');
    </script>
    I have added “DISPLAY_HTML'” as div in of display item like this.
    Pre element text
    <div id="DISPLAY_HTML">
    Post element text
    </div>
    It is displaying text if I manually refresh the page which I want to avoid.
    Anyone’s help is much appreciated.
    Regards

    Hi,
    Your code just set item P123_DISPLAY_HTML value to session state.
    It do not call any on demand process that could return something.
    Below code do not do anything else than trigger custom event in APEX 3.x. There is nothing out of box that bind to that event.
    $('# DISPLAY_HTML').trigger('apexrefresh');Maybe this old Carl's blog post help you to right direction
    http://carlback.blogspot.com/2007/12/apex-ajax-reports-and-you-and-bit-of-31.html
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • Dynamic actions in apex 5.0

    I have upgraded an application to apex 5.0 and have a few bugs related to dynamic actions.
    It seems that even when the "page items to submit" field has been filled in the session state/item value is not updated and consequently can not be used in the dyamic action.  (its possible I had set this manually via js in the html attributes but if so then this was lost due to conversion..possible but it seems less likely.)
    Has anyone had a similar experience or know of a way to fix this?

    Hi,
    as already pointed out the above code isn't really a JavaScript Expression, because it doesn't return anything. APEX 4.2 and previous versions where more forgiving, because they used eval to execute that dynamic JavaScript code. Eval is very forgiving and also accepts code which doesn't return anything. Because of security best practices, APEX 5.0 isn't making use of eval anymore and expects that the JavaScript expression is really an expression and not a JavaScript code block. Please see the documented change of behavior '4.24 Dynamic Action Set Value Action Set Type JavaScript Expression More Strict' in our Release Notes at https://docs.oracle.com/cd/E59726_01/doc.50/e39143/toc.htm#HTMRN310
    In my opinion the above dynamic action should actually be of type 'Execute JavaScript Code' instead of 'Set Value'. Because that's what it's actually doing.
    You can run the following SQL Statement in SQL Commands to get an idea which dynamic actions might be affected by this change of behavior. It searches for multi line JavaScript Expressions.
    select page_id,
           page_name,
           dynamic_action_name,
           action_name,
           attribute_05
      from apex_application_page_da_acts
    where application_id = 96695
       and action_code  = 'NATIVE_SET_VALUE'
       and attribute_01 = 'JAVASCRIPT_EXPRESSION'
       and instr( attribute_05, chr(10) ) > 0
    order by page_id, dynamic_action_name;
    Sorry for the inconvenience this security change has caused for you.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Dynamic Actions in Oracle APEX

    Hello all,
    I am using Oracle APEX 4.0.
    In an application, on a page I am using two standard dynamic actions
    to show particular items to the user.
    The first one is working fine but when I select the item which
    triggers second dynamic action the result of first one is
    reverted.
    I tried all the three event scopes bind, live and once.
    But it didn't worked out. Please suggest something?

    Your question is very vague, you ll have to provide more details about what each of those dynamic actions does.

  • How to abort tasks in a Dynamic Action when apex.confirm = Cancel

    I have a text field that has a Dynamic Action attached to it. When the field is changed, the Dynamic Action fires. There are 6 separate tasks in that Dynamic Action.
    The very first task is a call to apex.confirm. I want to make sure that the user understand the implications of changing the value in this field. So, up pops the dialog, the user reads the information, and decides to click OK or Cancel.
    If OK is clicked, I want to continue through the rest of the tasks in the Dynamic Action. If CANCEL is clicked, I want to just abort out of the Dynamic Action.
    Is that possible?
    Apex 4.1.1.00.23
    Edited by: Mark T. on Mar 1, 2012 9:49 AM

    Yes, I do see a different behavior.
    I've set up an app on apex.oracle.com, #60312. Workspace is mavericksolutions. Login pwolf. Password A1B2C3 change on first login.
    The first field is tied to a dynamic action. The first task in the DA is an apex.confirm. Type something into the first field then click TAB to bring up the dialog box. Whether I click OK or click CANCEL, the 2nd task is still occurring. It appears that the only difference is that if I click OK, I also get a submit of the page.
    What I want, in fact, is twofold:
    1. If I click CANCEL, then STOP the execution of the remainder of the tasks in the Dynamic Action.
    2. If I click OK, go ahead and process the rest of the tasks in the Dynamic Action, but DO NOT SUBMIT.
    Basically, I want to ask the user if it's OK to go ahead and make the on-screen changes, but I do NOT want to do an auto-save. I want the user to look at the results on the screen and click the actual SAVE (or CREATE) button after ensuring their accuracy. Right now, it appears that the apex.confirm is firing a page submit when I click OK (the fields get cleared out). I don't want that page submit.
    I THINK I can accomplish goal #1 with a workaround, by splitting the DA into two pieces. Piece #1 would have only the confirmation dialog. Piece #2 would be fired from the same field change, would have a sequence number AFTER piece #1, and would be conditional on the value of the expression returned by the apex.confirm. So if the apex.confirm returned 'DOTHIS' when I click OK, I would look to see if Expression = DOTHIS for piece #2. If not, then piece #2 wouldn't fire.
    The remaining trouble, then, is that if I click OK to fire piece #2, the page submit will subsequently fire following the completion of piece #2. And no matter what, I definitely do NOT want a page submit. Is there a function similar to apex.confirm that does not do a page submit?
    Anyway, take a look at the app. It's not performing the way that I anticipated, which is the same behavior that you described. I expected that it would do exactly what you said. Alas...

  • APEX 4.0.1: restriction on maximum number of dynamic actions on a page?

    Hello,
    I would like to know if there is a restriction on the number of dynamic actions on a page.
    I have a page with 29 dynamic actions. All works fine on the page.
    If I create another dynamic action that only display an alert or does anything else, I have the error message HTTP 404 when I try do display the page.
    If I delete an old dynamic action and create a new one then the page works fine.
    So after several tests, it seems that there is a maximum number of DA on a page but can someone confirm that?
    Environment:
    APEX 4.0.1
    Embedded PL/SQL Gateway
    Regards,
    Sddc

    I stand corrected in that some limits are acknowledged:
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/limits.htm
    Where are people getting these ideas that normal form or "Codd" said that there was a
    limit on columns and if you had more columns than a database product found convenient to implement that it was a 'design defect'? I took database management as an undergrad and in grad school and there was NO rule about number of columns. Anyone who says there is is shoveling pure bs. Even if there were such a rule, and there isn't, it is very inadvisable for a vendor who allows 1000 columns in a table in their database product to impose a limit that is 1/10 of that in an interface to their database. (And btw you can create a table (A 'wide' table, in sqlserver with 30,000 columns according to this:
    http://msdn.microsoft.com/en-us/library/ms143432.aspx )
    Artificially dividing up data instruments that were administered/collected at one time into pieces in separate tables, just to make a vendor's developers' life easier and more convenient, or just to keep the product from competing with the extremely extremely expensive "enterprise" products the vendor sells, is not acceptable.
    Splitting highly related data into separate tables for no reason other than the
    interface is not capable of handling it, creates a load of problems that would not otherwise
    exist. What if the user enters less than all the parts? Then someone has to figure out if the parts not entered had no data recorded in the source or if they were simply accidentally skipped. Basically someone or a program would have to enter those pages and denote they had no content if that were the case. Much more logic, much more opportunity for error vs keeping data that was highly associated together.
    A software vendor can apply whatever limits they want and no one can stop them, that's for sure. But what would be better here is making these more clear up front. This is a "rad" development tool for very small and not hugely complex forms and reports. Be clear and there will not be people royally steamed over spending their time and money evaluating a product that is not designed to do much of what people need it to do. This stuff should be in an FAQ and the top of the forum.

  • APEX 3.2 -  Dynamic Actions

    Hi,
    I know that we can apply dynamic actions in apex 4... can we do something similar in 3.2... if not, what's the alternative...?
    Thanks

    Hi,
    Dynamic actions are introduced on Apex 4 and there is not anything similar on Apex 3.2.
    But you can write your own JavaScripts. See e.g. this
    Apex 3.2 hook javascripts to IR and execute those when report is refreshed
    Regards,
    Jari

  • Apex 4.2 dynamic action to refresh a report region on a different page

    Hi,
    I open up a pop up window from a report region. When the user is done in the pop-up window and closes it, can I trigger a refresh on the report region using dynamic actions without actually reloading the whole page? I know I can use dynamic action on a page to refresh the report region on the same page.
    Thanks,
    Sinan

    Sinan,
    So long as the region to be refreshed is still loaded, you can do this. I don't know how you are loading your pop-up or unloading it but, the principle should be the same as what I provide below.
    Assume that you have set the static ID for your report to MY_REPORT. (Be sure you have checked "Allow Partial Page Refresh" in the Report Attributes).
    $('#confirmBox').find('div#userConfirmationMessage').html( '<span class="userInputRequest">Would you to Refresh your Report?</span>' );
    $('#confirmBox').dialog(
        autoOpen: true,
        modal: true,
        title: 'Refresh Conformation',
        buttons:
            'No': function ()
                $(this).dialog('close');
            'Yes': function ()
                $(this).dialog('close');
                 $('#MY_REPORT').trigger('apexrefresh');
    -Joe

  • Dynamic Action on apex items

    Hi,
    I have a requirement like after entering the date of birth in the item. then age value should be set dynamically.
    how can i set the value?

    Hi Tulasi,
    Follow the below steps
    Click on create button-Dynamic action
    select Advanced type
    Give some name
    event - On change
    selection type - item
    item(s) - your page item(used to select date of birth)
    condition - no condition
    action - Execute PL/SQL code
    Fire on page load - blank
    PL/SQL code -
    declare
    v_age varchar2(100);
    v_dob date;
    v_sysdate date;
    begin
    select sysdate into v_sysdate from dual;
    v_dob := :P1_DOB;    //here P1_dob is a page item from where i am selecting date of birth.
    select trunc(to_char((v_sysdate - v_dob)/365)) into v_age from dual;
    :P1_AGE := v_age;     // i have created one item named P1_AGE to display the calculated age.
    end;Page Items to Submit = P1_DOB // replace with your datepicker page item
    Page Items to Return = P1_AGE // replace with your item.
    Hope this will give you some idea.
    Thanks and Regards,
    Jitendra

  • Dynamic Action on item not working in APEX 4.2.1

    Created Dynamic action on item(Radio based on LOV) to show/ hide other items (event is Change). But its not working. I mean nothing happening onchange ..

    Based on the Radio item value "a" (Y/N) i am showing or hiding items b and c. All these items are in same region.
    Output seen : By default all the items are displayed and no action on changing the value of the radio item a.

  • Dynamic Action in APEX 4.2

    Hi,
    I try to use dynamic action but I cannot find the right event.
    The following:
    If the current -- v(APP_USER) - user is in group Administrator then the Items Name, Userid, Password, Group shold be editable else only the Password should be editable.
    In P0_GROUP there is the group of the current user.
    The page to show the Items is P6_NAME, P6_USERID ...
    I cannot find an action to start for example a PL/SQL funktion which return true or false. And what event is correct (page load?)
    Please help me.
    Regards
    Siegwin

    siegwin.port wrote:
    Hi,
    I try to use dynamic action but I cannot find the right event.
    The following:
    If the current -- v(APP_USER) - user is in group Administrator then the Items Name, Userid, Password, Group shold be editable else only the Password should be editable.
    In P0_GROUP there is the group of the current user.
    The page to show the Items is P6_NAME, P6_USERID ...
    I cannot find an action to start for example a PL/SQL funktion which return true or false. And what event is correct (page load?)
    Please help me.
    Regards
    SiegwinFirstly why are you using a dynamic action to achieve this?
    You should use read only attribute on those page items, See http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldapp_item.htm#HTMDB28297
    Vikram

  • Dynamic Action in Apex - Select list to Text field

    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number - Text field
    When a user selects CONSUMER, order number should automatically change to '1-' and user can enter only 14 characters (1-236666666666).
    When a user selects WHOLESALE, order number should automatically change to '2-' and user can enter only 12 characters (2-2155555555).
    Can someone please help to resolve this issue.
    Thanks in advance.

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Thanks Kiran. Actually ,order number should be disabled. only on selection of  order type, order number should be enabled, how do I do that?can you please help
    I can do fire on page load and disable order number .But how do i enable it again on selection of order number
        Let's say '1-' is prefix for Order Number when Order Type is 'CONSUMER' and '2-' is the prefix for Order Number when Order Type is 'WHOLESALE'.
        So a solution to your issue would be:
    Go to Page Attributes -> CSS -> Inline CSS and add the following class:
    .item_disabled {
      cursor: default;
      opacity: 0.5;
      filter: alpha(opacity=50);
      pointer-events: none;
    Create three elements PXX_ORDERNUM_PRE, PXX_ORDERNUM_SUF(as text Items) and PXX_ORDER_NUMBER(as hidden. Set Value Protected -> No).
    Arrange the PXX_ORDERNUM_PRE and PXX_ORDERNUM_SUF on one row.
    Set the "HTML Form Element Attributes" for PXX_ORDERNUM_PRE to this:
    readonly="true"
    Set the "HTML Form Element CSS Classes" for PXX_ORDERNUM_PRE to this:
    item_disabled
        NOTE : The above two points are to make the PXX_ORDERNUM_PRE element readonly, because if we disable the element we can't assign it a value.
    On the change event of PXX_ORDER_TYPE select list create dynamic action to populate PXX_ORDERNUM_PRE (as mentioned earlier)
    var ordertype = $('#P11_ORDER_TYPE').val();
    if (ordertype === 'CONSUMER') {
      $('#P11_ORDER_NUMBER_PRE').val('1-');
    } else if (ordertype === 'WHOLESALE') {
      $('#P11_ORDER_NUMBER_PRE').val('2-');
    Create an on-submit computation to concatenate PXX_ORDERNUM_PRE and PXX_ORDERNUM_SUF into PXX_ORDER_NUMBER.
    Create validation on PXX_ORDERNUM_SUF, if PXX_ORDER_TYPE is 'CONSUMER' the length should be 12 characters, if 'WHOLESALE' the length should be 10 characters.(excluding 2 characters of prefix).
         So this covers the following:
    On change of Order Type, Order Number Prefix should be set.
    Order Number Prefix should be not able to be modified, but the rest of Order Number should be able to be entered by user.
    Order Number should be of specific length depending upon the Order Type.
         Hope this helps!
    Regards,
    Kiran

  • Dynamic action with interactive report region refresh

    Hi!
    I'm using APEX 4.02
    I've got a page with 2 regions.
    Region1 is a (input) form
    Region2 is an interactive report on the same table as region 1
    When entering values on the form I'm trying to dynmically lookup similar records in the table with the interactive report.
    I've made a dynamic action on the change of the form fields which should refresh the interactive report region. I can see this one fires if I add a alert to debug if it fires.
    The dynamic report is based on a query with bind variables pointing to the form fields, for example
    where
    field1 = :P2_FIELD1
    This works great on the page load, so no dynamic action is fired but I can see the rows in the report region are the ones I am looking for.
    But the refresh of the report region is not working, it is never refreshing and/or showing the correct data after a change of the form fields, so it looks like the dynamic action "refresh region" is not working on the interactive report.
    Any ideas why this can go wrong ?
    I would like to solve this using standard dynamic actions and preferrably not via PL/SQL or JS, shoudl be possible if I should believe the documentation... ;)
    Cheers
    Bas
    Edited by: bklerk on 26-apr-2011 3:07

    Hi,
    When you change value to item, I assume you do not set value to session state.
    Use interactive report advanced attributes "Page Items to Submit" , set items session state before report is refreshed.
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/app_comp.htm#sthref1235
    Similar post/issue here
    Hide and show region - hides on refresh
    Regards,
    Jari

Maybe you are looking for

  • Payment term copy control

    Dear Gurus I am testing one scenario in which i need to maintain condition record of condition ABC with payment term. But i dont want to copy payment term in sales order item level. I am wondering where is the configuration of copying payment term fr

  • ME21N / ME22N / ME23N Purchase Order - batch

    Hi Guru's , Can any one tell me how the BATCH ( CHARG ) is updated as its not a field of EKKO and EKPO . Please help me for this as i have to create a zreport for PO details with conditions. Please Guide for the same . Thanks & regards, Archana W

  • Javascript on Lists - Resolved

    I'm trying to get a javascript action integrated into a list (shared components>lists). I've tried using both the internal page references and URL options, but can't for the life of me find a way to get the javascript integrated with the link in a wa

  • Setting for whether to resize images or not in exportContext.propertyTable?

    I have a plugin that creates multiple renditions of various sizes.  For the sizes I require, the image sizes are set with the two properties LR_size_resizeType and LR_size_maxHeight. The issue I am facing is that the rendering process only reduces th

  • Trouble with transferring uploaded CDs

    Hi, I'm having trouble transferring CDs I have uploaded into itunes into my ipod shuffle. I can still transfer any songs I have purchased through the itunes store, and albums I have uploaded into itunes in the past, but lately any new music I have up