APEX tabular form update recognition
805153Nov 6 2010 — edited Nov 9 2010
I am quite new to APEX so please apologize if I am asking "stupid" questions. Unfortunately, the information I was able to find up to now was only partially helpful. Apparently I must be missing something obvious. The APEX version I use is 4.0.1.
When submitting a page that contains a tabular form, I need to find out, which record has been created or updated in order to fill in additional information automatically, e.g. logging data (created, last updated, ...). I cannot do this in a trigger, because the trigger sees only APEX_PUBLIC_USER and does not know about the "real" user who has connected to the database. If there is a better or easier way to do this, please let me know.
My problem is to find out, if a new record has been added by clicking the "add row" button and / or if an existing record has been modified, because creation and modification have to be handled differently. Existing and unmodified records in the table must not be touched. I can access the columns by using APEX_APPLICATION.G_Fxx() but how do I recognize modifications? In a thread in this forum I found information about using a MD5 checksum. So I have added a checksum field using APEX_ITEM.MD5_HIDDEN() and tried to check this information. Unfortunately, doing this, I already get a problem when I submit the page after having added an empty record by clicking on "add row" but without having supplied any information. APEX then complains about information that has been modified in the meantime instead of just ignoring the empty record. This is probably because APEX considers the record as changed because of the checksum column I have added (I have read that the SQL query to create the tabular form must not be altered).
Could anybody please show me the right way to do such a check?
Thank you very much for your help.