Call a Automatic Row Fetch from a Dynamic Action

Hi,
can I execute the Automatic Row Fetch from a dynamic action?
I only found this post (Dynamic Actions to call Automatic Row Processing (DML) but the link where the solution is does not work :(
Thanks,
Edited by: Elena.mtc on 09-nov-2012 5:46

Elena.mtc wrote:
I forgot to say, for several reasons, I don't want to submit the page. So that's where I find the complexity in calling the ARf.
Thanks.You cannot fire the ARF because it is designed to run when the page is rendered and it cannot be called as a standalone
Create a dynamic action as follows to fetch the form detials
Action: Execute PL/SQL Code
PL/SQL Code:
begin
  select ename, job, mgr, hiredate, sal
    into :P4_ENAME, :P4_JOB, :P4_MGR, :P4_HIREDATE, :P4_SAL
    from emp
   where empno = :P4_EMPNO;
exception
  when others then
    null;
end;
Page Items to Submit: P4_EMPNO
Page Items to Return: P4_ENAME,P4_JOB,P4_MGR,P4_HIREDATE,P4_SAL
See this working example: http://apex.oracle.com/pls/apex/f?p=32940:4
Login as test/test
If you want to make it more dynamic you can query the APEX metadata to find the form items on your current page
select * from apex_application_page_db_items
where page_id =:APP_PAGE_ID
and application_id = :APP_ID;

Similar Messages

  • Calling a BI Publisher report from a dynamic action

    Greetings,
    I am working with Apex 4.1.0. I have created a BI Publisher query and layout and defined them in the Shared Components for my application. I also created a button defined as 'Download Printable Report Query'. When I press the button, everything works as expected. The page variable is passed to the report and the report prints as it should.
    My question is, can I run this report using a Dynamic Action instead of a button?
    Thanks
    Larry

    Hi,
    All that such a button does is submit the page and branch to page zero passing in the request field something like this:
    PRINT_REPORT=my_report
    So, to do the same in a dynamic action, use an "execute javascript code" action with something like this in it:
    location.href = 'f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=my_report';
    Luis

  • Automatic row fetch and items initialization

    Hi team,
    I was modifying a page and I came across the following situation:
    I had a form with MRU processing and automatic row fetch and I wanted to make SAVE and DELETE buttons conditional basing on a certain flag contained in the row being read.
    The flag is read into a hidden item having sequence number lower than any button, however I found out that the condition could not be reliably tested as the value in the session state was coming from a previous visit to the page. Some times the buttons were there, some not, at the beginning it was puzzling.
    So, I added a computation based on a SQL query where the hidden flag was computed before the header, basing on the primary key being passed from the calling page and the problem was gone, but for some reason I didn't feel satisfied, it was too cumbersome.
    I thought session state items would be assigned beforehand, but for some reason it looked like they were assigned at a later time, even if the automatic fetch process is supposed to run before the header.
    Then I noticed an "innocent" option in the fetch process definition saying "set memory cache on Fetch / set memory cache on Display".
    In my case was checked the former, but as soon as I checked the latter, I could remove the unnecessary SQL query computation.
    So, I started off posting a problem and ended up with the solution...
    Bye,
    Flavio

    Flavio,
    Thanks for the testimonial. That feature (new in 1.6) is for the very situation you described. When you create new row fetch processes they will have the "set memory cache on Fetch" option selected by default. For existing processes, the option must be manually changed.
    Scott

  • ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate

    ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
    1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
    TABLE NAME - EMP
    Item Containing PRIMARY KEY - P2099_EMPNO
    Primary key column - EMPNO
    By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
    2) Created a HTML region. Within this region add
    text item P2099_FIND_EMPNO
    Button GET_EMP to submit
    Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
    If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
    I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
    EXIST (SQL query returns at least one row)
    select 'x'
    from EMP
    where EMPNO = :P2099_EMPNO
    But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
    Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
    Any ideas?
    Thanks Pete

    Hi Mike,
    I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
    0.05: Show ERROR page...
    0.05: Performing rollback...
    0.05: Processing point: AFTER_ERROR_HEADER
    I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
    Thanks Pete

  • Bug Report: Automatic Row Fetch/Automatic Row Processing and invalid column

    Hi,
    if an invalid column name is specified for a page item of type "Database Column", no error is reported by the Automatic Row Fetch/Automatic Row Processing process. It's just ignored and nothing is returned!!! That makes it kind of hard to identify such an error.
    The problem can happen for example when a column is renamed or if there is a typo in the column name during creation.
    The problem seems to be related to the following query which doesn't use an outer join.
    SELECT C.COLUMN_NAME, C.DATA_TYPE, I.NAME, I.FORMAT_MASK, I.DISPLAY_AS
    FROM
    SYS.ALL_TAB_COLUMNS C, WWV_FLOW_STEP_ITEMS I WHERE C.OWNER = :B4 AND
      C.TABLE_NAME = :B3 AND I.SOURCE = C.COLUMN_NAME AND I.SOURCE_TYPE =
      'DB_COLUMN' AND I.FLOW_ID = :B2 AND I.FLOW_STEP_ID = :B1 AND (C.DATA_TYPE
      IN ('DATE','NUMBER','CLOB','LONG','FLOAT') OR C.DATA_TYPE LIKE 'NUMBER%' OR
      C.DATA_TYPE = 'CHAR' OR C.DATA_TYPE LIKE '%VARCHAR%' OR C.DATA_TYPE LIKE
      'TIMESTAMP%') ORDER BY C.COLUMN_IDBTW, if an invalid table/view name is specified for a Automatic Row Fetch/Automatic Row Processing process, the error message during runtime isn't very speaking.
    ORA-06550: line 1, column 17: PL/SQL: ORA-00936: missing expression ORA-06550: line 1, column 9: PL/SQL: SQL Statement ignoredMaybe that could be changed too.
    Thanks
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com
    The APEX Builder Plugin: http://builderplugin.oracleapex.info/
    The ApexLib Framework: http://apexlib.sourceforge.net/

    It says filed (with an L) not fixed (with an X). That means they have noted down the bug, but it may or may not have been fixed yet.

  • Multiple Automatic Row Fetches

    Hello All,
    Is is possible to have two "Automatic Row Fetches" on a single page. Each fetch pointing to a separate table.
    For example, one fetch gets employee data (name, address, etc.), the other getting time-off details.
    Thanks
    -redapple

    Ok, then why can't I make this work?
    Region 1 is a form and already exists on the page. Fully functional.
    I need to add a region to get supporting data from another table.
    Using the new region wizard, I create a new form region. A new "Automatic Row fetch" is created as sequence 10 as a "After Header" process. The "item containing "and "primary key" column are set accordingly.
    Whenever I run the page I get a "no data found" error.
    However if I delete the region, and recreate it as a report region, the report displays the data!
    What am I missing?
    Any ideas?
    thsanks
    -redapple

  • Automatic row fetch based on a select list

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i want to do automatic row fetch when the value of a select list changes ?
    but first i should ofcourse create a tabular form to fetch the data into it , but what i want is ,if i fetch 2 rows then the report contains only two rows , if i fetch 3 , the report contains only 3
    , if i fetch nothing , the report has nothing ?
    thanks

    Assuming all your page items are on separate rows, under your Page Attributes Header and Footer section, add the below function under Header Text:
    <script>
    function f_toggleNM() {
       // if P2_ATTACHMENT_TYPE value is D, then show row holding P2_CUSTOM_NAME and P2_CUSTOM_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_CUSTOM_NAME', 'P2_CUSTOM_MSG' ], 'C');
       // if P2_ATTACHMENT_TYPE value is C, then show row holding P2_DEFAULT_NAME and P2_DEFAULT_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_DEFAULT_NAME', 'P2_DEFAULT_MSG' ], 'D');
    </script>Under Footer Text, add the below:
    <script>
    f_toggleNM();
    </script>And on the P2_ATTACHMENT_TYPE item, Element tab, HTML Form Element Attributes, add below:
    onchange="f_toggleNM();"Hope this helps. Thanks!
    JMcG

  • How to use Automatic Row Fetch programmatically ?

    Hi
    I like to use Automatic Row Fetch (AFR) of APEX to populate data into a DML form page by clicking a button with a defined where_clause, and like to update the record accordingly as we did in Oracle forms execute_query procedure. I prefer Oracle provided facilities, don't want to do it manually. Any help ?....
    Hasan Al Mamun

    You will probably get a better answer if you ask this in the Apex - Oracle Application Express- forum.
    Sorry, I don't have an immediate answer for your question ;(

  • Creating an Automatic Row Fetch

    Hello,
    I'm trying to make an Automatic Row Fetch. The problem is that I have 3 values as a primary key in my table and I can fill in only two in the Row Fetch.
    Does anyone have a solution to this?
    Thanks in advance.

    Hi "user573175",
    I don't think APEX can do Automatic Row Fetch based on a pk of 3 values.
    I always try to limit my pk to 1 or 2 columns (as APEX has this limit).
    So my solution for you would be:
    - Use a PK of 1 or 2 columns and use Automatic Row Fetch
    - or Keep your 3 value PK and use a PLSQL function instead of the automatic row fetch
    Dimitri

  • 2 automatic row fetches based on the same variable

    I have a select list with a submit that contains all products that are currently stored in the database. The select list reloads the page and passes the value of the product id selected in the list to P3_PRODUCT_ID.
    I then use this value (P3_PRODUCT_ID) for two process under page rendering. One to fetch the associated fields in the Product table for the P3_Product_Id as this is the primary key and One to fetch the associated filed's in the Nutrion table for the P3_product_Id.
    This works fine if i only do one fetch process but if i try to both of the process i get
    ORA-01403: no data found
    Error ORA-01403: no data found
    OK
    which seems strange to me as the processes work fine individually.
    Anyone have any ideas or point me in the way of some reading? Is this even possible to use two automatic row fetches or do i need to write my own PL\SQL block?
    Many Thanks
    Daniel Stead
    Message was edited by:
    Dan Stead

    Only one ARF per page is supported.
    Scott

  • No automatic row fetching (DML)

    All,
    I want to generate a process which fetches my rows automatically.
    I've done this before several times.
    But now my new process is not fetching rows.
    I don’t get an error message, the text fields are just empty.
    During creating the new process I see an empty LOV
    for field ‘Item Containing Primary Key Column Value’
    in section ‘Source: Automatic Row Processing (DML)’
    although there are about 7 items (text fields) at this page.
    Any help appreciated,
    lucio

    Lucio:
    I think you need to set the 'Source Type' attribute of the form fields to be 'Database Column' and in the 'Source value or Expression' field provide the database column to which the page item corresponds to.
    varad

  • How  to delete(remove) one row(record) from a dynamic table

    Hi,
    I have adynamically created table.
    I want to delete 1 record(Row) from that Dynamic table.
    Say if my dynamic table contains 5 records(rows);after deletion of 1 record(1 complete row)from that dynamic table,the number of records(rows) should be 4 .
    Please suggest me how to proceed.
    Please provide me some sample code.Its not working
    I tried with these code:-Its not working-->
    IPrivateExportexView.IEt_WriteoffNode node=wdContext.nodeEt_Writeoff();
    IPrivateExportexView.IEt_WriteoffElement nodeEle= node.createEt_WriteoffElement(new Zfrm_Writeoff_P());
    node.removeElement(nodeEle);
    Please suggest
    Thanks
    -Sandip

    Hi,
    *int n=wdContext.nodeTable().getLeadSelection();*
    *wdContext.nodeTable().removeElement(wdContext.nodeTable().getTableElementAt(n));*   
    Further more , an example is given below for better understanding , do modifications according to your need.
    node :
           value node - Table (cardinality - 0..n , selection 0..1)
                              no    ( value attribute - string  )
                              name (value attribute - string )
       // create node elements 
         for(int i=0;i<5;i++)
        IPrivateClearnodeElements.ITableNode node = wdContext.nodeTable();
        IPrivateClearnodeElements.ITableElement ele = node.createTableElement();
        ele.setNo((101i)"");
        ele.setName("name :"(i1));
        node.addElement(ele);
    // Apply template Table -- select -- table node  or
    // create a table UI element and set the property Datasource - Table ( of the context)  
                             Insert Colum , in that column, next insert celleditor , of type text view  , bind the property text -- to "name " of Table node of the context
               Insert Colum , in that column, next insert celleditor , of type text view  , bind the property text -- to "no " of Table node of the context
    // create a action "removeElement"
    // create a button "Remove Element "  --> Event action -- removeElement
    // under the action write down the code :
    public void onActionremoveElement(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionremoveElement(ServerEvent)
        // before removing display elements
        wdComponentAPI.getMessageManager().reportSuccess("Before  deletion :");
         for(int i=0;i<wdContext.nodeTable().size();i++)
             wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeTable().getTableElementAt(i).getNo()) ;
         wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeTable().getTableElementAt(i).getName()) ;
        int n=wdContext.nodeTable().getLeadSelection();
        wdContext.nodeTable().removeElement(wdContext.nodeTable().getTableElementAt(n));
       // After deletion
        wdComponentAPI.getMessageManager().reportSuccess("After deletion :");
             for(int i=0;i<wdContext.nodeTable().size();i++)
                   wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeTable().getTableElementAt(i).getNo()) ;
                   wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeTable().getTableElementAt(i).getName()) ;
        //@@end
    If helpful , give points .
    Let me know if any problem u face .
    Thanks,
    Srini

  • Calling procedure with 2 parameters from a dynamic link

    I have just another question-
    I have a procedure testing_del_archive which is being called with 2 parameters...from a dynamic link in my SQL Query.
    The following is my code....
    SELECT re.report_exec_id, re.exec_userid,
    NVL(re.batch_exec_date, re.begin_date) report_date,
    re.rows_returned,
    re.status, re.error,
    f_file_url(re.filename) file_url,
    re.comments,
    ''Archive''archive
    FROM metadev.report_execution re, metadev.report r
    WHERE re.report_id = r.report_id
    AND r.spec_number = :v_spec
    AND re.status <> 'DELETED'
    AND re.exec_userid like (DECODE(:v_user_filter,'ALL','%',:v_user_filter))
    ORDER BY begin_date DESC
    The first parameter is the value in the execution id field and the second argument is hardcoded "Archived"...
    IT GIVES AN ERROR....
    Do you guys know where I am going wrong...

    You missed the ampersand symbol in between the parameters.
    This should be
    ''Archive''archive
    instead of
    ''Archive''archive

  • Subroutine called from a Dynamic Action.

    Calling a subroutine in a program via a dynamic action, works in foreground, but not in background? Any ideas why?

    What's a dynamic action and what are you actually trying to achieve?

  • Reading a session variable from a dynamic action

    I have a select list on a page and a button next to the select list. The button calls a dynamic action which opens a page and sends the value in the select list. The page is not submitted. The DA has a step with a dummy PL/SQL block that submits the select list item. Then the page is called with the select list in the URL.
    The value is not being sent. If I go into edit mode then run the page again then the correct value is sent.
    When I look at session in Administration the select list is in session and set properly but is not sent unless the page is submitted.
    Why if it is in session is it not being passed correctly? What does submitting the page do other than update session?

    Hi,
    could you share the exception trace ?
    Frank

Maybe you are looking for

  • Error: dynamic SELECT command in abap Opensql

    Hi! When I try to run this program, the session terminates, the work process restarts: DATA:   string1 TYPE STRING,   string2 TYPE STRING,   string3 TYPE STRING,   lt_trkorr TYPE TABLE OF E070-TRKORR. string1 = 'TRKORR'. string2 = 'E070'. string3 = '

  • Suppressing levels in cross tab.

    Hello All, I have a project requirenment for one of the client and currently using CR 2008 for creating dynamic reports based on a finance database for profitabilty Analysis. I have been using lot of Web-Elements functionality in my crystal applicati

  • Do anyone know how to stop reminders in iCal with ms exchange under iOS6 beta?

    Since I've started testing iOS 6 beta, I can't kill the reminders in exchange calendar....after restart the calendar app, they are there, again... Nothing to see in the mac cal app or in the owa! No reminders, especially on iPhone 4 and iPad 3, runni

  • 8100 Pearl - Does not initialize

    My device 8100 pearl is having problems starting  up.  For as long as the battery stays, the phone automatically starts trying to boot, fails doing so and shuts down with the red LED blinking at the right corner. This process keeps cycling without ev

  • Udp to local subnet

    hiho, i plan to send broadcast datagrams to the local subnet, but i have not been successful so far. in plain old j2se i could send datagrams to an address such as "192.168.10.255:1234" to reach all machines in the local subnet (in a simple network a