How to capture item updation in database block??? [message #84066] |
Sat, 24 January 2004 00:02 |
Victoria
Messages: 152 Registered: July 2002
|
Senior Member |
|
|
Hi,
I have one database block comprising of 15 columns in my form.I have one save button where i have written commit_form.
Now the problem is,
I need to insert a record into some other table if there is an updation to two specific fields in my database block.
Fo ex,
Table1 is having col1,col2,col3,col4,col5,col6.
Number of records shown are = 20(say).
So when i update 'col4' or 'col5' text items i need to insert a record into Table2.
Note that i have to insert only when there are changes in the values of 'col4' or 'col5'.
How to achieve this?
Thanks in Advance
~V~
|
|
|
|
|
Re: How to capture item updation in database block? [message #84118 is a reply to message #84066] |
Fri, 30 January 2004 22:30 |
Vamsi Mohan
Messages: 16 Registered: December 2003
|
Junior Member |
|
|
add the triggers pre-text-item, post-text-item
for the columns whose updation should trigger an
insert into table2
pre-text-item
-------------
:global.old_col4_value := name_in(:system.trigger_item);
post-text-item
--------------
if name_in((:system.trigger_item) != :global.old_col4_value then
....
insert into table2
values( val1,val2..)
...
end if;
The combination of these two triggers provides an indication that the value has been changed.
|
|
|
|