Dynamic action on the points of the apex

Hello

I have a requirement like after the entry of date of birth in the element. then the age value must be defined dynamically.

How can I set the value?

Hi Tulasi,

Follow the steps below

Click on create button dynamic action
Select the advanced type
Give a name

event - on the evolution of the
selection type - point
Article (s) element of your page (used to select date of birth)
condition: no strings attached
action - code PL/SQL Execute
Fire on the loading of the page - white

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 elements to send = P1_DOB / / replace with your agenda of the datepicker page

Elements of the page return = P1_AGE / / replace with your article.

Hope this will give you an idea.

Thank you and best regards,
Jitendra

Tags: Database

Similar Questions

  • APEX 5. Dynamic action on the CHANGE event does not work after applying the filter on IR.

    APEX 5.

    Dynamic action for the CHANGE event does not work after applying the filter on IR.

    Event: Change, selection Type: jQuery Selector, jQuery Selector: td [header = 'abc'] entry

    Real action

    Selection type: jQuery Selector, jQuery Selector: td [header = 'abc'] entry, Action: run the Javascript Code

    Is TI WHEREAS behavior?

    I know, I can work around this problem by using the Refresh event and javascript, but I prefer DA and if possible Change event.

    Concerning

    mdyla

    mdyla wrote:

    It is, how to force them reallocate dynamic Action in the event of CHANGE of the input elements after refresh of IR region.

    Set the dynamic scope of the event action to Dynamics.

  • dynamic action sets the value of the element, but not save to DB on submit

    I'm working on a page where the value of several to show only the page elements are defined using a dynamic Action.  They are set when the user selects a value in a list of selection (and is based on the value of the selection list).  Dynamic action is triggered on a list selection change event and then runs the real action "set the value.  The selection list displays the names of sales representative.  The three fields dynamically filled are the org structure (that is, their chain management).

    For the action to set the value, I use a defined Type of SQL statement:

    Select VP, DIR, MGR

    of SALES_ORG where SSR =: P20_SSR

    In the affected elements, I have fixed Type of selection to the 'item (s)"and the value of the Item (s) for 'P20_GVP, P20_DIR, P20_MGR.

    Dynamic action works fine for the display of the page (that is, when I select a sales representative in the selection list dynamic action properly updated only display value fields three).  This page is a form in which the user submits information relating to the rep.  When the page is sent, all fields are filled in a new record of DB with the exception of three that were populated dynamically above.  These fields get the values NULL.

    When the dynamic action updates the values in the three fields is - it does not set the value of session?  Why these fields don't are not taken into account in the submit other ideas > process Page?

    I use 5 APEX with Chrome on Mac (Yosemite).

    Thanks for the note.  I didn't only display the items could not be used in this way.  I think I'll take a different approach with the design; given that the org structure is in another table that I can simply refer to that by rep when necessary rather than saving the information uploaded to the page of the form.  The reason why I have not fill the screen only the points of loading the page is because I don't know what the values should be until the user selects a sales representative in the selection list.

    I'll change the design to one of the following:

    1) change the display only items of standard text field.  NOTE: if I make the text read-only field that causes other problems when loading (I get the message "violation of protection Session state").

    OR

    2) do not include org structure in the download folder and just refer to table org Rep when necessary.

    Thank you!

    Steve

  • Dynamic action - Get the difference between two dates + times

    I have problems a little dynamic to work action. I'm trying to get the time between two dates with the time difference.

    Here is what I got (this is apex 4.0):

    Two date pickers + two numbers fields (date/start/end times)

    I created a dynamic action on the page who fires on the point lose focus (above points).

    The real action for the DA is the body of the PL/SQL function:
    declare
      end_date DATE;
      start_date DATE;
    Begin
      start_date := to_char(:P1_START_DATE || ' ' || :P1_START_TIME, 'DD-MON-YYYY HH:MIAM');
      end_date := to_char(:P1_END_DATE || ' ' || :P1_END_TIME, 'DD-MON-YYYY HH:MIAM');
      :P1_HOURS := end_date-start_date;
    End;
    When I change the values on the page, I get the following error:

    AJAX call back Server error ORA-06502: PL/SQL: digital or value error: character number conversion error to set the value.

    I'm guessing that there is a problem with the date formatting, but I can't make it work. Thanks in advance!

    Hi djston,

    because you chose the dynamic action of 'Set value' with the "Body of the PL/SQL function" type you need to return the value. Try the following code

    declare
      end_date DATE;
      start_date DATE;
    Begin
      start_date := to_date(:P1_START_DATE || ' ' || :P1_START_TIME, 'DD-MM-YYYY HH:MIAM');
      end_date := to_date(:P1_END_DATE || ' ' || :P1_END_TIME, 'DD-MM-YYYY HH:MIAM');
      RETURN (end_date-start_date)*24;
    End;
    

    and P1_REQUESTED_HOURS like 'item affected. "

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

    Published by: Patrick Wolf on January 17, 2011 10:54

  • Dynamic action - defining the value of affected parts

    Hello

    I'm a little trouble trying to set the value of several items affected in dynamic Action (refresh the number of the part to Page 2). Page 2 I want the user to select the order number and fill in the items combines automatically, for example part number Descr. I can make it work for Part_Number, but the same value appears when I add P2_DESCR to items assigned to set the value. I'm probably doing something really stupid!

    http://Apex.Oracle.com/pls/Apex/f?p=11536:2

    Kind regards

    Mickey

    Hi Mickey,

    It is not as easy as it should be, even. You certainly do not make something stupid at all!

    Currently the action 'Set value' support only 1 distinct value. You might have other 'Action' within the same dynamic action that returns the other element you want, but it's inefficient, you need to make 2 round trips to the server to retrieve each value. We are looking for the opportunity to put multiple values without needing more trips to go back out of the box in a future release, but for now I think the best approach is to use a custom mix of dynamic measurements, JavaScript and a level of page AJAX callback.

    For this example, I use the EMP table, where the user selects the number and the name of the employee and employment are returned, but the technique can be used for your situation.


    1. Add a page 'AJAX Callback' called 'GET_EMP_INFO', make the type "PL/SQL" with a "Point of process" of "On Demand - run this process when requested by AJAX ' and add the following code:

      begin
          for c in (select ename, job from emp where EMPNO = to_number(:P1_EMPNO)) loop
           apex_util.set_session_state('P1_ENAME', c.ename);
              apex_util.set_session_state('P1_JOB', c.job);
              /* Add more set_session_state calls here if you want to return more item values */
          end loop;
          apex_util.json_from_items('P1_ENAME:P1_JOB');  /* Add more here for returning more values */
      end;
      

    2. Create a dynamic action "Advanced" (because we need to use the action "Run JavaScript Code"), with the following attributes:

      • 'Change' - to the fire of the dynamic action every time the number value used change event.

      • Selection of Type 'Article (s)' - to be able to select the element of page employee number.

      • Article (s) "P1_EMPNO" - the page employee number element.

      • Real Action "to execute JavaScript Code. If you want details on the loading of the page as well, make sure that the 'Fire when loading the Page' checkbox is checked. Add the following "Code":

        var get = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=GET_EMP_INFO', $v('pFlowStepId'));
        get.add('P1_EMPNO', $v('P1_EMPNO'));
        gReturn = get.get();
        json_SetItems(gReturn)
        get = null;
        





    So, basically, that's all. I recommend this approach for now, until better support us in native mode to set multiple values, or a plug-in dynamic action arises that does just that!

    Hope that helps.

    Kind regards
    Anthony.

  • Can not set a value by the executed dynamic action on the page element "selection list."

    I created an agenda of the page 'list of selection' and I want to when I change a value in another element of the page set only 'screen '.

    I created a dynamic action on the page element "selection list" for this.

    These are the dynamic action attribute:

    When:

    ======

    Event: change

    Selection type: point

    Article: P29_PURCHASE_ORDER

    Condition: No strings attached

    Advanced:

    ========

    Scope of the event: static

    Identification:

    ==========

    Action: Set

    The ' Action Page when the changed value "attribute of the element of 'list of selection' = 'None', and when I run form the dynamic action run and set the value for once and do not update the value according to the change in the article"list of selection. "

    Note: when I change the previous attribute of 'Redirect and set', dynamic action run and properly value, but the value was hidden soon

    I want to value when the value of change of select list according to this change successfully.

    Please, advice me,

    Best regards

    Mustafa Ezzat

    Hello

    you set the value of the 'Page elements to submit' to P29_PURCHASE_ORDER?

    Then, the SQL statement would use the current selected value.

    This is the help text says: "specify a list separated by commas of the elements of the page that will be submitted to the server and therefore available for use in your"SQL statement"," PL/SQL Expression"or"Body of the PL/SQL function".»

    Kind regards

    Erik-jan

  • Help with dynamic action and the selection list item

    G ' Day Apex gurus.

    I have problems trying to achieve to trigger the Help window from an element automatically select. A Help window is triggered when it is clicked on the label of an item, but my customer wants to be triguered automatically as soon as the user clicks to view the options in the select list.

    I think I should be able to do with dynamic actions but I can't function.

    I know when someone clicks on the label of the item selection list trigger this JavaScript

    JavaScript:popupFieldHelp('277938589795252851','1545903379570909')

    So I want to trigger the javascript also when the user click on the item selection list and pull down the options and for that I think that the dynamic action is the way to go, but I can't do things.

    That's what I have to do:

    I created a dynamic option as follows:

    Name: test
    Sequence: 30
    Even: click
    Selection type: product (s)
    Article (s): P1_RATING <-a selection list item
    Condtion: - no requirement.

    Real Actions
    Sequence: 10
    Action: Run the JavaScript Code
    Fires when the result of the event is: true
    Fire on loading the page: checked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')

    Thank you anyone who can tell me what I'm doing wrong here or bring a solution to my problem to trigger the Help window from an element automatically select.

    Kind regards
    Carlos

    Hi Carlos,

    I've set up a test case of exactly in the same way and it worked fine for me. I've created a page element called P1_DA_DEMO and added some values of the static selection list, then added a help text. I used the settings are lower, I suggest you try again, but also make sure that you have no other Javascript errors on the page. Use a tool like firebug to check.

    Name: Action Dynamics demo
    Sequence: 10
    Even: click
    Selection type: product (s)
    Product (s): P1_DA_DEMO<- a="" selection="" list="">
    Condtion: - no requirement.

    Real Actions
    Sequence: 10
    Action: Run the JavaScript Code
    Fires when the result of the event is: true
    Fire on loading the page: unchecked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')

    Scope of the event set a Bind s.

    Thank you

    Paul

  • Dynamic action on the region

    Hello

    Request Express 4.1.0.00.32

    I have a report region on a page that is conditionaly displayed depending on the value of an element of page Pn_ITEM = "HIDE".

    I have dynamic stock running on the page that fill a collection and update the report without the need to submit the page. However, I need to show the report somehow when the collection contains at least one of the members present.

    I tried the following:

    1st real action running pl/sql that adds a record / member of a collection, then a 2nd action sets the value to a page Pn_ITEM = true 'SHOW' action item and a 3rd that should show the region based on the value of the real action 2.

    My collection has an added member. The value 'SHOW' is applied to my article on Pn_ITEM page by the dynamic action but the region of report I want now displayed is not displayed. Obviously if the page is submitted, the report will now be shown however I can't send the page at this stage that's why I need to do this dynamicaly or through javascript and on the application process.

    Any ideas how to get my region report to display once the collection has at least one member without submitting the page?

    Thanks in advance.

    Remove the requirement for the view from the region. You don't want this here since it completely stops rendering region if the condition is not fullfilled to the render time. You want that he made, but not displayed.

    Add css to the region (inline, class):

    style="display: none;"
    

    Add real action that will do a refresh on your area (component - refresh, select your report as an affected item region).

    Now, either:
    Add a real action of type run javascript. Since you can not put conditions on the real actions, we will test the condition in javascript.
    Choose one:

    if($v("Pn_ITEM")=='SHOW'){
    //if you want to target the region to be shown by an ID (static id?)
    $("#region_id").show();
    };
    
    if($v("Pn_ITEM")=='SHOW'){
    //if the triggering element would be the region to be shown
    $(this.triggeringElement).show();
    };
    
    if($v("Pn_ITEM")=='SHOW'){
    //if you'd want multiple affected elements to be shown at once drop the [0]
    $(this.affectedElements[0]).show();
    };
    

    Create a new dynamic action that has the same conditions of release as your other dynamic action.
    Specify a when condition:

    $v("Pn_ITEM")=='SHOW'
    

    Create a real "Show" type action to show the region.

    Final result should be your dynamic action creating an item in the collection, an update of the report based on the item (but still not represented) and finally a show in the region.

    Remember that stocks will also fire on page load (so don't forget to check the box on the actions of true), otherwise the region does not appear initially.
    I would say that the item is probably not necessary, but depends on any other logic, you might have on your page and possibly interacts with it.

  • Tips: APEX 5 r IR by a dynamic action after the text fields complete

    Hello I hope I can get assistance on this matter and thank you in advance for any information.

    I have an APEX 5 screen, that has 4 fields of entry of text and under this one IR that has these 4 parameters in its SQL where clauses.

    Now if I create a button that submits page or redirects to this page my report can be updated with the values of user entered without problem, basic stuff.  If I create the settings section as a dialog box model once again that I can get the update report as this dialogue submits the page as well as the report can refresh according to closed dialog option.

    What I struggle to reach is to allow the user to enter values in the text fields click on a button called 'submit' and there all stages of implementing dynamic action without page reloading.  I want user to P1_A, P1_B, P1_C, P1_D press on "submit" input, dynamic action that links the values entered into the fields, then fire another dynamic action that updates the State when the button is clicked / modified values what works the best.

    I am struggling to get this to work and I even tried to copy these settings and do them as hidden for example bind input P1_A to P1_A_Hidden by a dynamic action and have the report where clause =: P1_A_HIDDEN, but have not managed to get this working.

    It's possible?  I know its easy to simply send the page and make it work, but I want the experience to be quite uniform for the user and act as you never leave the page.

    I saw on the packages of the app in the chart example.  The bubble chart has a list selector (salary) and the table updates dynamically, it seems so that the process can occur, but I need the user to enter text and not use selection lists.

    My apologies if I missed any, but I can give you more if it helps.

    Concerning

    1972903b-5166-494e-8355-08d9d4006e96 wrote:

    Hello I hope I can get assistance on this matter and thank you in advance for any information.

    I have an APEX 5 screen, that has 4 fields of entry of text and under this one IR that has these 4 parameters in its SQL where clauses.

    What I struggle to reach is to allow the user to enter values in the text fields click on a button called 'submit' and there all stages of implementing dynamic action without page reloading.  I want user to P1_A, P1_B, P1_C, P1_D press on "submit" input, dynamic action that links the values entered into the fields, then fire another dynamic action that updates the State when the button is clicked / modified values what works the best.

    The button simply trigger a unique dynamic action of refreshment on the IR region. Session state for page elements must be processed automatically by specifying them in the property Page to submit Items of the IR region.

    Please ensure that you have updated your forum profile with a recognizable username instead of "1972903b-5166-494e-8355-08d9d4006e96": Video tutorial how to change username available

  • Apex 4: Feature missing dynamic action for the region of calendar

    Hello

    If I create calendar view region Type 'Partial Page Refresh' it do not support fully dynamic actions.

    For me, for example event "discount for after ' are not triggered



    Kind regards
    Jari

    Published by: jarola on October 20, 2010 15:53

    Hi Jari,

    that is not yet supported, but it will be something that we seek to add to the 4.1

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Dynamic action on the DOM object does not

    Through dynamic action, I will execute PL/SQL Code that creates a point using additional APEX_ITEM. CHECKBOX (see the code on the bottom). Through another dynamic action, I am trying to run additional Java. I put it in the fire like this:

    Event: click on
    Type: DOM object
    The DOM object: return [0] .f11 (this corresponds to the value of fxx APEX_ITEM.checkbox)

    Just try an alert ("hi") simple. does not work. Am I missing something?


    DECLARE
    l_hold_table_name varchar2 (1000): =: P1223_HOLD_TABLE_NAME;
    l_hold_html varchar2 (32000): = ";
    l_hold_session_state varchar2 (32000): = ";

    CURSOR get_columns IS
    Select b.column_heading, b.column_name
    of the double

    BEGIN

    l_hold_html: = ' < DIV > < TABLE border = "2" > < THEAD > < TR > < TH > ' | l_hold_table_name |
    ' < /TH > < /TR > < / THEAD > ';

    FOR x in get_columns LOOP
    l_hold_html: = l_hold_html | "< TR > < TD >. APEX_ITEM. CheckBox(20,x.column_name,null) | x.column_heading | "< Table > < /TR >";
    END LOOP;


    l_hold_html: = l_hold_html | ' < / TABLE > < DIV > ';

    : P1223_HOLD_INNERHTML: = l_hold_html;

    END;

    Hello

    I did the work... you need to do is you second dynamic action (onclick with query selector) in the Advanced section of the value range of the Live event

    Here http://apex.oracle.com/pls/apex/f?p=60428:4 example is functional

    Kind regards
    Aljaz

    Published by: Aljaz on 8.3.2012 15:44

  • Dynamic action - when the 'event' and 'condition' seems to have no sense

    Step by step, I am trying to get free Javascript coding so I can rely on what natively offers the Apex. It was an interesting experience, however I have noticed certain situations sicesdonneessontdisponibles options seems to have no sense, at least to date, and you will certainly help me which can be cleared up. I tried to put one of them into words. I just created a new dynamic action that will just set the focus to an element whenever my page is loaded.

    Why my new dynamic action allows me to choose the "Page loading" event and condition "sucks"? I don't understand why this combination is available. There is probably no effect anyway, but I decided to leave the condition "without condition."

    Thanks in advance.

    Franklin.Jr wrote:

    Step by step, I am trying to get free Javascript coding so I can rely on what natively offers the Apex. It was an interesting experience, however I have noticed certain situations sicesdonneessontdisponibles options seems to have no sense, at least to date, and you will certainly help me which can be cleared up. I tried to put one of them into words. I just created a new dynamic action that will just set the focus to an element whenever my page is loaded.

    Why my new dynamic action allows me to choose the "Page loading" event and condition "sucks"? I don't understand why this combination is available. There is probably no effect anyway, but I decided to leave the condition "without condition."

    It's just that there is a basic LOV status of one size for all types of events. Most of the conditions it contains is relevant to events associated with the elements. "Page Load" + "sucks" doesn't in fact make sense, but 'P4_END_DATE' + 'is null' fact. The Condition property remains visible and active so that the option "JavaScript expression" are available, as this can be used to make any event conditional.

  • Dynamic action using the datePicker in APEX5.0

    I want to use dynamic action with dates in APEX 5.0 picker such that after the selection of start_date and end_date interactive report should display data for the selected date range.

    I first created an interactive report in the APEX and then created a page with date elements pickers.ln my database table, I have a column name time_stamp, who is with the date format varchar2 data type YYYY-MM-DD - HH24:MI:SS.

    Looks like my request for interactive report below:

    Select * from table1 where time_stamp between to_char(to_date(:p1_item,'YYYY-MM-DD-HH24:MI:SS'),'DD-MM-YY') and to_char(to_date(:p2_item,'YYYY-MM-DD-HH24:MI:SS'),'DD-MM-YY')

    (where p1_item and p2_item are the page numbers for the selectors of dates), the 'Mask of Format' attribute for the selectors of dates, I put to JJ-MM-AA. Now, I need to define a dynamic action to run my SQL query of interactive report based on the selected start_date and end_date arguments. I need to know more about the steps to create such dynamic action and look for the detailed steps to what attributes must be defined to achieve this.

    Help, please.

    Thank you

    Mukul

    I did notice that the column time_stamp was varchar2. You can use this query:

    select *
      from table1
    where to_date(time_stamp, 'YYYY-MM-DD-HH24:MI:SS') between to_date(:p1_item, 'DD-MM-YY')
      and to_date(:p2_item, 'DD-MM-YY')
    

    And if you remove it your selectors of dates format mask then you could be simpler:

    select *
      from table1
    where to_date(time_stamp, 'YYYY-MM-DD-HH24:MI:SS') between :p1_item
      and :p2_item
    

    You have need of other attributes.

  • A collapsible region with the dynamic Action of the collapse

    Hi all

    in my Apex 5.0 - application, I have a button that shows a masked area when you press. I wish also that the current developed a collapsible area collapse when this button is pressed. Since collapse a collapsible region is not native as a dynamic action I must find a custom way (JavaScript) to do. Anyone know the best way to do this?

    Kind regards

    Arjan

    Hi Sunil,

    Thanks for your reply. I already found a solution, just a JavaScript code very simple:

    document.getElementById("div1").classList.remove("is-expanded");

    document.getElementById("div1").classList.add("is-collapsed");

    Thanks anyway!

    Best regards, Arjan

  • dynamic action on the selected value shuttle

    Hello

    Can anyone help me in this.

    I guess a requirement

    There is a shuttle Apex and multiple selection is allowed

    and there are values such as:-others, first, second

    but when we choose other no other value should be able to select

    in what other is selected in the shuttle a textbox is displayed by dynamic action

    example on https://apex.oracle.com/pls/apex/f?p=76604:3:4326822625865:

    workspace:-REEMATEST

    username:-test

    password:-test

    76604 application

    page 3

    ReemaPuri wrote:

    can you give me a link for the dynamic creation of checkbox

    FOR EXAMPLE BASED ON CREATED LOV SHARE COMPONENT

    Select the column name as the name of column d, r

    the name of the table

    Boxes are just another way to make a LOV. For a dynamic set of checkboxes, the standard pair of value/label LOV SQL projection is required in the definition:

    select initcap(dname) l, to_char(deptno, 'tm9') v from dept
    order by v asc
    

    If additional values are required, they can be included in the query using unions:

    select initcap(dname) l, to_char(deptno, 'tm9') v from dept
    union all
    select 'Other', 'OTHER' from dual
    order by 2 asc
    

    Checkbox events can be handled by dynamic actions as indicated on page 586 of your test App. Note that I prefer to enable and disable the controls on form rather than hiding and showing them that there is less confusion for the user. It is simple to change the disable/Enable dynamic actions to hide and show if necessary.

Maybe you are looking for