1 Reply Latest reply: Jul 13, 2013 1:51 PM by Walt K RSS

    Testing for Insert after ApplyMRU runs

    Walt K

      Apex 4.0, Tabular forms.

       

      I have 2 tabular forms. First is a master. Second is a detail. On separate pages.

       

      I would like to automatically redirect to the detail if a new record is inserted on the master.

       

      I thought maybe I could test #MRI_COUNT# for 1 after APPLYMRU runs.

       

      So I,

       

      1. Set up a process after APPLYMRU that retrieves the high key off the master and updates a page item with the value.

      2. Set up a branch to call the detail and set a page item in the detail to the master page item set in #1.

       

      Tried to make both conditional on item=value #MRI_COUNT# = 1. Neither fired.

       

      Is the concept of testing #MRI_COUNT# flawed? Is there a better way to do this.

       

      Thanks!

        • 1. Re: Testing for Insert after ApplyMRU runs
          Walt K

          I came up with a solution that works. Not very elegant. A bit brute force. But it works.

           

          1. Inserted a PL/SQL block process that executes On Submit before ApplyMRU. Captured high key on the table. Moved it to Pxxx_OLD_KEY.

          2. Inserted a PL/SQL block process that executes On Submit after ApplyMRU. Captured high key on the table. Moved it to Pxxx_NEW_KEY.

          3. Put a branch to the detail page that ran on the condition that Pxxx_OLD_KEY != Pxxx_NEW_KEY and SUBMIT key button pressed. Passed Pxxx_NEW_KEY to the detail page.

           

          If there were updates only the before and after key would be the same. If the DELETE button was pressed the Branch would not execute.

           

          Not particularly proud of it. But it works so far.