Executing dynamic action JS then plsql code with checkbox.

All,
I have a checkbox which when clicked i want to run javascript expression then next plsql code in that sequence. But iam getting the first issue here when i put in JS an expression like document.getElementById("P111_CHECK1").value ... or even document.getElementById("P111_CHECK1").checked i always get undefined error. So how can i determine if the checkbox is checked or unchecked in DA? thanks in advance.

Hi,
still stuck here on how do i check/uncheck a single checkbox in Apex i tried via dynamic action JS expression like this but doesnt work ==> document.getElementById("P111_CHECKBOX1").checked = true/false; Any help on this pls?

Similar Messages

  • Dynamic Action Set Value - PLSQL Error - cannot contain an expression

    I am trying to use below in a Dynamic Action to Set Value with PL/SQL Function. The dynamic action does not update the item appropriately. I tried to run the below directly in SQL Workshop but received the error "PLS-00372: In a procedure, RETURN statement cannot contain an expression". How can I get below to return the value needed?
    DECLARE
    rqstdaloe number;
    rqstdeloe number;
    devpercent number;
    rqsttarget date;
    timeleft number;
    PSPTime number;
    DevTime number;
    DevPer number;
    BEGIN
    SELECT SUM("TRACK_TIME_SPENT") INTO rqstdaloe
    FROM "TIME_TRACKER"
    LEFT JOIN "TBL_R66_TASK_TYPE" ON "TASK_TYPE_ID" = "TRACK_TYPE"
    WHERE "TRACK_REQUEST_ID" = :P2_REQUEST_ID AND "TASK_TYPE_TYPE" = 'DEV';
    rqstdeloe := :P2_REQUEST_ELOE;
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO DevTime
    FROM "TIME_TRACKER" TT1
    LEFT JOIN "TBL_R66_TASK_TYPE" TT2 ON TT1."TRACK_TYPE" = TT2."TASK_TYPE_ID"
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY AND TT2."TASK_TYPE_TYPE" = 'DEV';
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO PSPTime
    FROM "TIME_TRACKER" TT1
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY;
    DevPer := ROUND(DevTime/PSPTime,2)*8;
    timeleft := TRUNC(((NVL(rqstdeloe,0) - NVL(rqstdaloe,0))/DevPer)+.99999,0);
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;
    RETURN rqsttarget;
    END;

    Hi Dave,
    just a quick hint. If you just want to have the time part of a date/sysdate, you can use TRUNC to do that. So your existing code
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;could be changed to
    rqsttarget := trunc(sysdate) + timeleft;If you perform a TO_DATE on a date variable, the PL/SQL engine will first convert that date variable with an implicit type conversion to a VARCHAR2, because the TO_DATE interface only supports VARCHAR2's and NUMBER's.
    But implicit type conversions are always dangerous, because if your default date format mask isn't mm/dd/yyyy your TO_DATE will fail.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Executing Dynamic actions in Background???

    Hello Experts,
    We have a requirement where we need to automate PA40. The data would be sent in csv file and we need to perform the required steps to insert data into Infotypes.
    The issue is in batch mode (background mode), the dynamic actions wouldn't be called and the business wants the dynamic actions to be considered as well.
    Pls let me know if there is any way we can interpret the dynamic actions dynamically; meaning the prog should be able to handle the newly created dynamic actions as well.
    Any pointers to this are highly appreciated.
    Regards
    RK

    Hello Raj;
    In documentation of  Dynamic Actions it is written so:
    Note on creating a batch input session:
    Dynamic actions are not processed in a batch input session.
    In batch input, you must specify the exact sequence of the screens. To
    ensure this is the case, you must have already programmed the dynamic
    action checks before you create the batch input session.
    To avoid errors only the static actions are processed when you program
    and process a session. Infotypes that usually only appear in the system
    as a result of a dynamic action should be updated by calling up the
    transaction separately.
    Hope this can help you,
    Regards.
    Okan

  • Executing tiny programming language compiled byte code with the JVM

    Hello,
    For a project, I am developing a simple programming language, with a syntax not unlike Pascal, which compiles to Java Byte Code. Currently I execute the compiled byte code using my own interpreter. This works OK, but what I'd like to do now is to execute the compiled byte code using the actual existing JVM. The compiled byte code resides in a text file upon compilation of a sample program written in my tiny programming language. Does anyone know how I may start to go about this? Thanks in advance.
    adam

    The only way of getting a standard Java virtual machine to execute your java byte code, is to wrap it up into a completely valid java class file.
    Any constants you use, must be put into the classes constant pool.
    Any local variables will have to go into the local variable table of the method which uses them... etc, etc.
    Something like ASM, would let you dynamically create a Java class file.
    http://asm.objectweb.org/
    regards,
    Owen

  • Dynamic Action on Item Value Change with AjaxRequest not working

    Hello,
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a Query to find the email for the new user selected and stick it in text field P222_EMAIL.
    I have an On Demand process on the change of P222_USERS that calls a javascript function:
    fetchEmail($('#P222_USERS').val());
    In my header, the function calls an Application Process in an Ajax request:
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
                             ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
                             ajaxResult = ajaxRequest.get();
    Here is my On Demand PLSQL Process GET_EMAIL:
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    end;
    The email is not getting populated into :P222_EMAIL. I know i'm close, but have already spent a bunch of time with various alternates to the above function/on demand process. Any help is greatly appreciated. I wish the PL/SQL process on the item change worked in this manner instead of going through AJAX.
    Thank you,
    Johnny

    Johnny98 wrote:
    Hello,
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a Query to find the email for the new user selected and stick it in text field P222_EMAIL.
    I have an On Demand process on the change of P222_USERS that calls a javascript function:
    fetchEmail($('#P222_USERS').val());
    In my header, the function calls an Application Process in an Ajax request:
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
                             ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
                             ajaxResult = ajaxRequest.get();
    Here is my On Demand PLSQL Process GET_EMAIL:
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    end;
    The email is not getting populated into :P222_EMAIL. I know i'm close, but have already spent a bunch of time with various alternates to the above function/on demand process. Any help is greatly appreciated. I wish the PL/SQL process on the item change worked in this manner instead of going through AJAX.
    Thank you,
    JohnnyThe fact is that your application process sets the items value in the session state and not populate the value on client/browser side
    So you need to return the value from on demand process and assign the value in javascript like this
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
    ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
    ajaxResult = ajaxRequest.get();
    //newly added
    alert(ajaxResult);
    $s('P222_EMAIL',ajaxResult);
    //amend your On Demand PLSQL Process GET_EMAIL like this
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    //newly added
    htp.prn(:P222_EMAIL);
    end;This way the value will be set into session state and client side as well

  • Problem with dynamic actions

    Hi,
    I am creating the following dynamic action configuration for my custom infotype 9902. My requirement is to Insert a new record of Additional payments (0015) infotype with wagetype (LGART) = 9GHS and Amount(BETRG) = 1000 when the value in field "ALL_ENROLL" is created/changed.
    <u><b>INFTY|SUBTY|FIELD             |FC|No|S  | Variable function</b></u>
    <b>9902      |           |ALL_ENROLL |06 |20 |I   | INS,0015,,,(P9902-BEGDA),(P9902-ENDDA)
        9902  |           |ALL_ENROLL | 06|30 |W| P0015-LGART='9GHS'
        9902  |           |ALL_ENROLL |06 |40 |W| Q0015-BETRG='100000'</b>
    The dynamic action is getting triggered properly with Wagetype(LGART) being populated properly. But the value in Amount(LGART) is not getting populated. The technical details of the amount field shows the field as Q0015-BETRG.
    Can someone help me in acheiving this?
    Thanks,
    Prasath N

    Problem solved. The documentation for dynamic action states that,
    <b>Do not set defaults for Q fields of an infotype because the values for these fields are derived from the corresponding P fields.
    Examples
    Infotype  Subtype  ..... FC  Ind.  Variable function part
    0021       2              04  I     INS,0015,M430
    0021        2              04  W     P0015-BETRG='10000'
    When a Family/Related Person record (0021) record with subtype 2 (child) is created, an Additional Payments record (0015) with a default amount of 100.00 is created.
    </b>
    Thanks,
    Prasath N
    Message was edited by:
            prasath natesan

  • Dynamic action on tabular form

    Hi all,
    I'm working on a page with a tabular form. Based on the value of a radio button group, some of the columns has to be hidden. I have some experience with dynamic actions, but not in conjunction with tabular forms. I guess I have to use a jquery expression, but that's another area I don't have any experience in...
    Can someone help me or give me some directions? I'm on Apex 4.1
    Tom
    Edited by: Tom van der Duin on 22-okt-2011 12:02

    Hi there,
    I am using Apex 4.0 and it seems to generate tabular forms like this:
    <th id="START_DATE" class="header"> headings
    <td headers="START_DATE" class="data" style=""> data cellsSo, you can use the Javascript code below to hide and show a column based on its name:
    function hideShowTabularFormColumn(name, show){
      if(show) {
        $("td[headers='"+name+"']").show();
        $("th.#"+name).show();
      } else {
        $("td[headers='"+name+"']").hide();
        $("th.#"+name).hide();
    onsomesortofevent="hideShowTabularFormColumn('START_DATE', false);"Note that, even hidden, the fields will still be submitted.
    Luis

  • Dynamic actions on OM Infotypes

    Hi All,
    Can we use dynamic actions for OM infotypes?

    Hi
    for dynamic actions for OM infotypes try with
    include the required infotypes in V_T582A     Infotype attributes (Customizing)
    and write your code in V_T582A     Infotype attributes (Customizing)
    Regards
    Sri

  • How to process Dynamic Action in BDC

    Hi friends.
    We are using HR_INFOTYPE_OPERATION to update some infotypes. The problem is that dynamic action does not get triggered as SY-BINPT = 'X' when we use this FM or BDC to update.
    Now, is there any workaround so that we can process dynamic actions via our program?
    Can somehow we call the subroutine DYN_ACTION from our program? Can the values of PSAVE etc be availabe in our program?
    Thanks in adv!

    Hi
    Its kind of complicated to code dynamic actions in your BDC code. However , I would try my best to make you understand.
    1. Make a BDC recording of the source screen.
    2. Dynamic actions are stored in table: T588Z. Now during your screen processing of BDC data, you have to check the conditions yourself whether this was the condition which triggers the dynamic action.
    3, Make another BDC recording of the target screens which are called due to dynamic actions. Now if the condition in the source screen is fullfilled and you have to call a dynamic action then direct your program flow to the BDC recording of the target screen and update all the fields which would be updated by Dynamic Actions in the normal user interaction of that screen.
    In short, you have to program all those things which Dynamic action does since BDC does not support dynamic actions.
    Reward points, if helpful.
    Regards
    Waz

  • Sending mails using dynamic actions

    Hi
    How we can send mails using dynamic actions.
    Regards
    Santhosh

    Hi,
    Sending mails is possible by using the feature M0001. This is to be coded in the dynamic action depending on the requirement with function code "M".
    Hope this would help you to explore further. Incase of any specific query you can post back.
    Regards
    Tharak

  • Straightforward dynamic action not working properly in 4.1 anymore

    Our application has a page with a great number of checkboxes all using the same LOV ('Y','N'). We defined a simple dynamic action that fires whenever the first checkbox is changed. If its value is set to 'Y' the value of all the other checkboxes is set to 'Y' as well. A false action does the reverse. This worked fine in 4.0. In 4.1 it still fires but instead of the complete list of affected items only the first item of that list has its value set. When we change the action to be fired from 'Set Value' to -for instance- 'Hide' or 'Disable' it works fine again (i.e. affects the entire item list).
    Has anyone an idea what can be the problem here?
    Robert.

    Hi Robert,
    I think you are hitting "4.9 Dynamic Action Set Value with Multiple Affected Elements" documented as change of behavior in the release notes of APEX 4.1 http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21672/toc.htm#CACFHAFB By coincident Mark Lancaster also blogged about it a few days ago. http://oracleinsights.blogspot.com/2011/09/dynamic-actions-changed-behavior-in.html
    BTW, if you have so many Y/N checkboxes, you might want to have a look at our "Simple Checkbox" item type plug-in at http://apex.oracle.com/plugins
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Execute javascript from plsql in a dynamic action.

    Is it possible to execute javascript with htp.p from a plsql block in a dynamic action (on change).
    I have tried it but I get a JSON error.
    The reason I want to to this is:
    I have to check something with plsql and depending on the result I want to do something in javascript.
    I now going to try it with ajax from javascript, but if somebody has a other way to do this i like to hear it.
    Thanks,
    Fred.

    Very neat, many thanks.
    I now have a 'Set Value' 'Javascript Expression' action of 'this.triggeringElement.id;' to set a hidden *but unprotected* page item. This is followed by the 'Execute PL/SQL' action which simply calls a package procedure and passes the name of the triggering item. The procedure then sets the session state(s) as required.
    Thank you!

  • Dynamic  action - execute pl/sql code

    Hi All and thanks fro any assistance.
    I am trying to Execute the following pl/sql Code in a dynamic action however get the following error - AJAX call returned server error ORA-01403: no data found for Execute PL/SQL code.
    I have all page items iin the page items to submit section.
    declare
      l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
      l_file           IMM_DOCUMENTS.FILE_BLOB%type;
      l_filename       IMM_DOCUMENTS.FILENAME%type;
      l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
      l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
    begin
        select f.blob_content,
               f.filename,
               f.mime_type,
               nvl(f.file_charset, f.dad_charset)
          into l_file,
               l_filename,
               l_mimetype,
               l_charset
          from wwv_flow_files f
         where f.name = :P80_FILE;
      if l_file is not null then
        insert into IMM_DOCUMENTS
          sub_id,
          document_type_id,
          filename,
          file_blob,
          file_comments,
          file_mimetype,
          file_charset
        values
          :P80_SUB_ID,
          :P80_DOCUMENT_TYPE_ID,
          l_filename,
          l_file,
          :P80_FILE_DESCRIPTION,
          l_mimetype,
          l_charset
        delete from wwv_flow_files where name = :P80_FILE;
      end if;
    end;

    Hi Marie,
    as Matthew says, the only part of the code that could result in that error is the select into statement. This is because, in pl/sql, a select into statement is expected to return one row only. If it returns no rows it raises a no data found exception and if it returns more than one row it raises a too many rows error.
    If it is acceptable that this query may return no rows, then you have to handle this situation. The two methods that you can use would be firstly to use a named cursor and fetch a row from this, if there is no data then it does not raise an exception. The other method would be to put in an exception handler around the select statement.
    EG - prefered, mainly because I think it is better to code in a way that minimises exception handling.
    declare
       l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
       l_file           IMM_DOCUMENTS.FILE_BLOB%type;
       l_filename       IMM_DOCUMENTS.FILENAME%type;
       l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
       l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
       CURSOR file_cur IS
         select f.blob_content,
                f.filename,
                f.mime_type,
                nvl(f.file_charset, f.dad_charset)
           from wwv_flow_files f
          where f.name = :P80_FILE;
    begin
       OPEN file_cur;
       FETCH file_cur INTO
                l_file,
                l_filename,
                l_mimetype,
                l_charset;
       CLOSE file_cur;
       if l_file is not null then
         insert into IMM_DOCUMENTS
           sub_id,
           document_type_id,
           filename,
           file_blob,
           file_comments,
           file_mimetype,
           file_charset
         values
           :P80_SUB_ID,
           :P80_DOCUMENT_TYPE_ID,
           l_filename,
           l_file,
           :P80_FILE_DESCRIPTION,
           l_mimetype,
           l_charset
         delete from wwv_flow_files where name = :P80_FILE;
       end if;
    end;
    OR
    declare
      l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
      l_file           IMM_DOCUMENTS.FILE_BLOB%type;
      l_filename       IMM_DOCUMENTS.FILENAME%type;
      l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
      l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
    begin
      BEGIN
        select f.blob_content,
               f.filename,
               f.mime_type,
               nvl(f.file_charset, f.dad_charset)
          into l_file,
               l_filename,
               l_mimetype,
               l_charset
          from wwv_flow_files f
         where f.name = :P80_FILE;
      EXCEPTION
        WHEN no_data_found THEN
          NULL;
      END;
      if l_file is not null then
        insert into IMM_DOCUMENTS
          sub_id,
          document_type_id,
          filename,
          file_blob,
          file_comments,
          file_mimetype,
          file_charset
        values
          :P80_SUB_ID,
          :P80_DOCUMENT_TYPE_ID,
          l_filename,
          l_file,
          :P80_FILE_DESCRIPTION,
          l_mimetype,
          l_charset
        delete from wwv_flow_files where name = :P80_FILE;
      end if;
    end;Note : code is untested.
    Regards
    Andre

  • How to clear grey loading screen and animated gif (Dynamic Action with "Show Processing" on submit)

    APEX V4.2.3
    DB 11.2
    I have a classic report on page 1.  I have a region button called "Export" (defined by a submit dynamic action with "show processing=Yes") that submits the page and then via a branch directs me to page 2 which has a slightly different version of the report on page 1 (i.e. no breaks) which I want to capture as a CSV export.  Therefore I've set the report template on page 2 to " Export:CSV".
    Now when I click on the page 1 export button the grey screen and loading gif appears indicating that the report is executing and then as expected, page 2 doesn't appear but instead the standard open/save window's dialog box appears asking to open or save the generated CSV file.  All good..but the grey loading screen remains.  How do I clear this loading screen and get back to the context of page 1 ?
    thanks in advance
    PaulP

    Hi PPlatt,
    We would love to help but you left out one crucial part of the puzzle: namely how does your CSV report get exported. With the way it is setup (a redirect to another page), I'm going to assume you do that because you have some PL/SQL on that page that prints the CSV.
    Now there are two questions that are crucial here:
    - How do we stop the icon from bugging us on the screen
    - How do we communicate with the browser that it should no longer display the loading icon
    The first question is rather easy, two simply lines of codes can do that:
    $('#apex_wait_popup').hide();
    $('#apex_wait_overlay').hide();
    But when do we use this code? Quite simple when the document is downloaded. When is it downloaded? At the end of the PL/SQL code that prints the document to the browser.
    What you could do is at the end of that code give an application item a certain value. For example :AI_PRINTED := 'Y';
    Then all you need to do is let the browser ask for the value. You could do this by using JavaScript to continuously fire AJAX to the server using a JS timing event:
    http://www.w3schools.com/js/js_timing.asp
    Better would be a Server send event, but since you left out another crucial piece of information: your browser, I will not go deeper into this.
    Start this timing event when someone asks for the document, and end it as soon as the process returns that :AI_PRINTED equals 'Y'.
    Despite the lack of information, I hope I have given, or at least inspired you to get to the solution.
    Regards,
    Joni

  • Display item with HTML affected by dynamic action

    Hi,
    I'm using APEX 4.1.1
    I have a item P1_TEST set as "Display only", escaping special characters "no", and the source as pl/sql expression of
    'hello <b>world</b>'I then create a dynamic action executing PL/SQL on click of a button.
    P1_TEST is listed in both "page items to submit" and "page items to return", and it doesn't matter what happens in the pl/sql code - it could just be null;
    When opening the page, I see
    hello world
    as desired.
    After clicking the button, the field contents become escaped and I see hello <b&GT;world</b>which is not desired.
    Is this expected behaviour / a bug? Is there a workaround?
    Cheers
    Scott

    Hi Scott,
    This was indeed a change of behaviour from 4.1.1 to 4.2 and has to do with how APEX handles input escaping (or when saving values into session state). I should say, we plan to revisit the current behaviour to make this more transparent and obvious, but that won't be for 4.2, for your information.
    As you identified, the escaping is happening as part of the 'Page Items to Submit' functionality, so in other words when the item value is saved in session state. APEX has some predefined rules about when and when not to do input escaping based on the item type, and this is what has changed slightly from 4.1.1 to 4.2.
    In 4.1.1, regardless of whether item values are set via the URL or via an Ajax call, the same rules applied for when APEX does input escaping. We always input escape the 'safe' item types. These types used to be documented in the 3.2 documentation, here: http://docs.oracle.com/cd/E14373_01/appdev.32/e11838/sec.htm#CDDBBECI
    (Obviously the item types have changed slightly with the consolidation of some of those into single items, with different settings. But hopefully that is still of use, and we no longer cite them in the same way in recent documentation so I couldn't link to something more recent.)
    In 4.2, this behaviour was 'relaxed' slightly, such that this logic only kicks in when setting values over the URL, not for Ajax calls. This is why this is no longer an issue with your DA, because we no longer obey the same item type escaping in the context of an Ajax call.
    As a workaround for 4.1.1, I would suggest to use a non-safe item type to set your value into (eg a 'Hidden' type), then use JavaScript just to copy that over to your displayed item. The 'unescape' function didn't work, because that does URL unescaping, not HTML unescaping.
    Hope that helps,
    Anthony.

Maybe you are looking for

  • How can I disable Library/Home Sharing in iTunes?

    So, i have two apple computers connected to the same network, one iMac connected via ethernet cable, one MBP connected to wifi. There are also other apple products connected to the same network but i don't think they have any relation to the problem

  • Apple studio display and lion

    Is my old Apple Studio Display, with a ADC connector, compatible with Lion - I'm getting to upgrade from Snow Leopard.  Thanks

  • How to set the value of .lastvisible and .firstvisible

    hi, in ITS i'm using a loop on a table control. The counter starts with GV_SOS_LIST_CTRL.firstvisible to GV_SOS_LIST_CTRL.lastvisible and displays 2 rows per navigation. How(or where) should i increase the value of GV_SOS_LIST_CTRL.lastvisible so tha

  • 2007 Daylight Savings Time Changes

    What, if any, effects will the 2007 changes to US daylight savings time have on the operation of the LabVIEW 7 Express development environment and deployed applications created with it?

  • SyncAll error

    Hello.  I just added a new domain controller to our network.  When I attempt to run a repadmin /syncall, it all seems to go well until the end.  I end up with the following error: SyncAll reported the following errors: Error issuing replication: 1722