Home » Developer & Programmer » Forms » Problem with post text item trigger
icon8.gif  Problem with post text item trigger [message #218000] Tue, 06 February 2007 05:59 Go to next message
mk_agg1969
Messages: 19
Registered: August 2006
Location: india
Junior Member
Dear All,

I am having a form which is based on master detail relationship.
For example in detail block I have following feilds:
Debit_credit_flag, Ex_Rate, Currency_amount, D_Amt, C_Amt.

I written some validation code on Feild Currency_Amount on Post_Text_Item trigger as under:
If Nvl(:vchr_dtl.currency_amt,0) <= 0 then
Declare
alt number;
Begin
--
Set_alert_property('w_msg',alert_message_text,
'Currency Amount Should Be Greater Than Zero');
alt := Show_alert('w_msg');
Raise Form_trigger_failure;
--
End;
End If;
--
if :ref_vchr_no is not null then
If Nvl(:vchr_dtl.currency_amt,0) > :global.bill_amt then
Declare
alt number;
Begin
--
Set_alert_property('w_msg',alert_message_text,
'Currency Amount Should not Be Greater Than Bill Amount.');
alt := Show_alert('w_msg');
Raise Form_trigger_failure;
--
End;
End If;
end if;

Now say if user has entered 14 records in detail block and in 15th record user by mistake entered a record having bill_amt as 0.00 then system will not allow him go out of the text box.

Is there any way to change the code little bit without disturbing the controls which mentioned above.

Your quick response will help me a lot.

Regards,

Manoj Aggarwal
Re: Problem with post text item trigger [message #218004 is a reply to message #218000] Tue, 06 February 2007 06:10 Go to previous messageGo to next message
simple_ora
Messages: 50
Registered: September 2006
Location: UAE
Member
Just code this validation in KEY-NEXT-ITEM trigger
and use form_trigger_failure.

And go to the property of this item and select reuired property is true...
It will do ...
shefiq
Re: Problem with post text item trigger [message #218014 is a reply to message #218004] Tue, 06 February 2007 06:56 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Validation should be done in the WHEN-VALIDATE-ITEM trigger. Not POST-TEXT-ITEM, not KEY-NEXT-ITEM.
Previous Topic: Forms_Ddl Problem
Next Topic: Oracle and MSSQL
Goto Forum:
  


Current Time: Fri Sep 20 15:29:23 CDT 2024