functionality of when-validate-item trigger [message #412536] |
Thu, 09 July 2009 17:23 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cool_coder
Messages: 17 Registered: September 2008
|
Junior Member |
|
|
hi,
I am coming across one issue in oracle form-application..here are the details:
there are two fileds A_DATE field and B_DATE field..
per business requirement A_DATE should always be less than B_DATE and for that , there is a trigger (when-validate-item ) on A_DATE which takes care of it and it doesn't allow user to go against that check.
However, in that application , there are other menu options/features, and by selecting one of them , user can change the A_DATE to be todays's date ( date comes from database) and that can be greater than the B_DATE. that way it looks like when-validate-button is not getting triggerd so over-riding the rule.
Any idea , how to put this check , ( i.e. on when system updates the field).
Thanks in advance.
|
|
|
|
Re: functionality of when-validate-item trigger [message #412601 is a reply to message #412536] |
Fri, 10 July 2009 02:22 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Put that logic into the WHEN-VALIDATE-ITEM trigger; something like this:
if :a_date = trunc(sysdate) -- or another condition which tells
then -- that :a_date's value has been acquired differently
null;
else
if :a_date >= :b_date then
message('do not do that');
raise form_trigger_failure;
end if;
end if;
|
|
|