Making form not to update, once inserted (processed) with msg [message #613021] |
Mon, 28 April 2014 23:55 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/992da6a980f827486b1fe245e2db9d3f?s=64&d=mm&r=g) |
afzaa2yahoocom
Messages: 24 Registered: April 2011 Location: Dubai
|
Junior Member |
|
|
Hi All,
My Custom form captures the OverTime hours of the Employee each day of the month in XXOTHRS table, Once the month is processed the XXOTHRS has column named 'PROCESSED', it will update to Y for corresponding employee,month.
My requirement is if the employee for that month is processed (Processed = 'Y') then the employee of that month should not be updated, and to show msg that this emp is already processed.
Shall I try with database trigger on table...?
Kindly suggest.
Regards,
Afzal.
[Updated on: Mon, 28 April 2014 23:56] Report message to a moderator
|
|
|
Re: Making form not to update, once inserted (processed) with msg [message #613024 is a reply to message #613021] |
Tue, 29 April 2014 00:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
How do your users update these values? Through this form only, or by some other tools as well (I suppose they don't use SQL*Plus, but - maybe some other form?). If so, a database trigger might be a better solution because - if there are several forms, you'll have to restrict access in all of them.
However, if it is just that form, a form trigger might be another option. I'd go with PRE-RECORD trigger which would check whether PROCESSED item is set to 'Y'. If it is, SET_ITEM_PROPERTY would modify UPDATE_ALLOWED property to FALSE. Otherwise, set it to TRUE (don't forget to do that because the first processed employee would cause all that follow to be non-updateable as well).
|
|
|
|
|