Saving Forms [message #292043] |
Mon, 07 January 2008 10:10 |
daibatzu
Messages: 36 Registered: September 2007
|
Member |
|
|
Hello, I am creating a form to save data to a table. Now, this table has columns like last_updated_by, last_update_date e.t.c. For my forms I am using the commit_form PL SQL code for saving the form. Is there a way for me to update these values each time a form is saved without showing them on the form? Also, how can I get the name of the person who updates the data as well, in other words a record history?
Thanks
|
|
|
|
Re: Saving Forms [message #292113 is a reply to message #292043] |
Mon, 07 January 2008 21:27 |
mintomohan
Messages: 104 Registered: November 2006 Location: India
|
Senior Member |
|
|
hi,
you can write the following code in the PRE-INSERT trigger of the data block.
:BLOCK.LAST_UPDATED_BY := :GLOBAL.APPLICATION_USER;
:BLOCK.LAST_UPDATE_DATE := SYSDATE;
You can create a global variable called APPLICATION_USER to store the name of the user.
Minto
|
|
|
|
Re: Saving Forms [message #292411 is a reply to message #292152] |
Tue, 08 January 2008 21:59 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
You could also write a database trigger to populate these fields.
Have you handled updates as well as inserts? Do you need to know who deleted a record?
David
Up: Doh, I had 'how' instead of 'who' again.
[Updated on: Wed, 09 January 2008 19:30] Report message to a moderator
|
|
|
Re: Saving Forms [message #292502 is a reply to message #292043] |
Wed, 09 January 2008 01:40 |
daibatzu
Messages: 36 Registered: September 2007
|
Member |
|
|
Hi djmartin, those are good points. I've only been able to save using commit_form on the "when button pressed" condition.
How about if I wanted to use the save button in oracle instead.
How would I write the PL code for saving the form details in that situation?
I'm googling into writing database triggers at the moment.
|
|
|
|
|