Search code examples
sqloracle-sqldeveloperoracle-apex

Dynamic Action In ORACLE APEX - Populating a Field from Form on Page 2 using data entered into Field from Form on Page 1


I have 2 pages, containing 1 Form Each (Page 1 has ACCOUNT INFORMATION, Page 2 has CARD INFORMATION) in an Oracle Apex Application I'm building.

When the user enters their Account Number in the ACCOUNT INFORMATION form, in Field P1_ACCOUNT_NUM and they save their entry, THEN the same Account Number must be Auto Populated into the CARD INFORMATION form in Field P2_AID (This page item is used as a Foreign Key coming from ACCOUNT INFORMATION)

I would like to have this accomplished using a Dynamic Action OR, if deemed easier, using a Process.

Note: Both forms are triggered by a CREATE button. Both forms are based off of Tables from a DATABASE bearing similar name.

How can I accomplish this?


Solution

  • Usual way to do that is to

    • create P1_ACCOUNT_NUM
    • create P1_BTN button which redirects to page in this application
      • target is page 2
      • in link properties, set P1_ACCOUNT_NUM item as a "source" and P2_AID as a "target" item
    • run the form
    • populate P1_ACCOUNT_NUM
    • when you press the button, Apex will redirect you to page 2 and P2_AID will have value you entered into P1_ACCOUNT_NUM

    Whichever way you choose to navigate from one page to another, you should use any available option to pass values between those pages. Link is the most usual way:

    • you can create it as a button (as in my example). Or,
    • create it dynamically in e.g. Interactive Report source query, utilizing APEX_PAGE.GET_URL function.

    As usual, there's more than one way to do that.