5 Replies Latest reply on Nov 14, 2017 11:56 AM by anand_gp

    How to execute pl/sql after press of submit button

    anand_gp

      Hello,

       

      For a Master Detail form, I wanted to know if we can execute pl/sql function/procedure (may be through javascript?) after press of Submit button (Apply Changes)?  (apex 4.2.6)

       

      Thanks,

      -Anand

        • 1. Re: How to execute pl/sql after press of submit button
          fac586

          anand_gp wrote:

           

          For a Master Detail form, I wanted to know if we can execute pl/sql function/procedure (may be through javascript?) after press of Submit button (Apply Changes)? (apex 4.2.6)

          Depending on the precise requirements, create a PL/SQL page process or application process at the appropriate processing point and call the function/procedure from there.

          • 2. Re: How to execute pl/sql after press of submit button
            Gor_Mahia

            Hi,

            you can create process #2 in the sequence that assigns a values to hidden item then create DA based on change of the hidden item to trigger any js/jquery/plsql etc.

             

            regards

            • 3. Re: How to execute pl/sql after press of submit button
              anand_gp

              Hi Fac,

               

              The exact requirement is like -

              Under "Add Items" HTML region, "Add Item" button will execute a pl/sql procedure, that creates a new record in "SALE BILL Detail" Table at the same time, it updates "Total Amount" in Master Table.  Post that, Page Refresh happens and newly added record is visible under Detail region.  All good upto here.

               

              The QTY column in Detail region is editable and based on change in QTY column, AMOUNT will be updated using javascript but "Total Amount" in Master Table is not updated (users can modify multiple rows).  I wanted to know, after SAVE (apply changes) button, if I can execute a pl/sql procedure which updates TOT-AMT (because, all changes to Detail table is already saved and using that detail, TOT-AMT in master table can be updated.  For new record creation there is no issue.  Only during modification I face this issue.

               

              Regards,

              -Anand

              • 4. Re: How to execute pl/sql after press of submit button
                fac586

                anand_gp wrote:

                 

                The exact requirement is like -

                Under "Add Items" HTML region, "Add Item" button will execute a pl/sql procedure, that creates a new record in "SALE BILL Detail" Table at the same time, it updates "Total Amount" in Master Table. Post that, Page Refresh happens and newly added record is visible under Detail region. All good upto here.

                 

                The QTY column in Detail region is editable and based on change in QTY column, AMOUNT will be updated using javascript but "Total Amount" in Master Table is not updated (users can modify multiple rows). I wanted to know, after SAVE (apply changes) button, if I can execute a pl/sql procedure which updates TOT-AMT (because, all changes to Detail table is already saved and using that detail, TOT-AMT in master table can be updated. For new record creation there is no issue. Only during modification I face this issue.

                This is a really bad idea. Calculated and derived information should not be persistently stored in transactional database tables precisely to avoid this kind of update anomaly.

                 

                Calculate the total using dynamic actions and JavaScript for display purposes only:

                 

                • 5. Re: How to execute pl/sql after press of submit button
                  anand_gp

                  Hi Fac,

                   

                  Thanks.  I agree with you.  Have changed the design.  And it works.  Thanks for sharing the details.

                   

                  Regards,

                  -Anand