3 Replies Latest reply: Apr 30, 2013 9:42 AM by gerhard2001 RSS

    General question regarding calling a procedure from a tabular form


      I am new to APEX (well all of Oracle really so only have limited knowledge of PL/SQL etc too) but have created a couple of simple applications via wizards. One of these has a tabular form which works fine for updating records for the table that the form was built over but I need a way to write a record to a second (audit) table as well.

      My form is used for cycle counting of items in a location. It originally shows the quantities of all the items in a location and allows the user to make corrections by updating any incorrect quantities to the correct value (this would then update the quantity column in the main table). It then needs to calculate the difference between the old and new value and write this as a record to an audit file (might be a positive or negative number).

      I am confused about how tabular forms would work to do this......do I call a procedure once (on submitting the page) and get the procedure to loop through the changed records writing to my audit file OR do I call my procedure once per changed record on the tabular form, if so how do I know what parameters to pass to the procedure?

      I have tried researching this online but can find no easy to follow examples. All examples of code I have seen for tabular forms refer to fields referenced by apex_application.g_f01 or f02 etc - how do you know what items on the page these relate to?

      Any help would be greatly appreciated