Home » Developer & Programmer » Forms » functionality of when-validate-item trigger
functionality of when-validate-item trigger [message #412536] Thu, 09 July 2009 17:23 Go to next message
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 #412580 is a reply to message #412536] Fri, 10 July 2009 01:12 Go to previous messageGo to next message
shaz
Messages: 182
Registered: June 2009
Senior Member
can you elaborate more on your problem??? If possible give some examples to explain.
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
Littlefoot
Messages: 20895
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;
Previous Topic: spell number to word in arabic
Next Topic: FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-01422
Goto Forum:
  


Current Time: Mon Dec 05 19:02:53 CST 2016

Total time taken to generate the page: 0.16400 seconds