Home » Developer & Programmer » Forms » When_Validate_Item trigerr
When_Validate_Item trigerr [message #176079] Tue, 06 June 2006 18:29 Go to next message
her_today
Messages: 5
Registered: June 2006
Junior Member
I am new to Oracle forms and I am have a Production problem with a GBL application. This app contains ffive tabs on the canvas. The Voucher Header tab is causing a problem. See the trigger used and problem discription.
GBL has the following trigger for item Voucher_Header.Voucher_No
When_Validate_Item with sql code
begin
select CARRBILLNO.NEXTVAL
into :VOUCHER_HEADER.VOUCHER_NO
from DUAL;
exception
when others than
message('Problem in When Validate Item");
end;

First time when entering a new header and detail, the number gets populated in the voucher_no field when I tab out the header block. Enter remainder of the record and save the record. Use the clear all option under the Action menu. When the second record is entered the voucher no does not increment when I tab out of the header record.

Any advice would be greatly appriciated.

Thanks
Re: When_Validate_Item trigerr [message #176460 is a reply to message #176079] Thu, 08 June 2006 06:38 Go to previous messageGo to next message
gacki
Messages: 33
Registered: May 2006
Location: Dueren, NRW, Germany
Member
Quote:

When the second record is entered the voucher no does not increment when I tab out of the header record.

So it shows the same value as for the first record?

Generally I think something happens during Save and/or during Clear All. Can you check the respective triggers for "unusual" code?

Gerald
Re: When_Validate_Item trigerr [message #176521 is a reply to message #176460] Thu, 08 June 2006 10:35 Go to previous messageGo to next message
her_today
Messages: 5
Registered: June 2006
Junior Member
No the value is blank on the second record. Because the trigger did not fire, no nextval was entered. If second record was saved, it would be populated to the tables with a blank voucher no. Yesterday, I was display some help about the voucher no field for both the first and the second record. "Item is Valid" was TRUE for the first record, and FALSE for the second record. Not sure if that helps.

Thanks
Re: When_Validate_Item trigerr [message #176532 is a reply to message #176079] Thu, 08 June 2006 12:05 Go to previous messageGo to next message
Rehan Mirza
Messages: 67
Registered: July 2004
Location: Pakistan
Member

Use this trigger code on Pre-Insert or When-Validate-Record in Voucher Header Block

Begin
If :System.Block_Status in ('NEW','INSERT') then
select CARRBILLNO.NEXTVAL
into :VOUCHER_HEADER.VOUCHER_NO
from DUAL;
End If;
end;

If you Use When-Validate-Record then use IF condition other wise you without condition


Best regards
R E H A N M I R Z A
Re: When_Validate_Item trigerr [message #176568 is a reply to message #176532] Thu, 08 June 2006 15:38 Go to previous messageGo to next message
her_today
Messages: 5
Registered: June 2006
Junior Member
It appears that the pre_insert will work, but within the next block (Line), it also contains the same Voucher No. The item properties used the Copy from Item and it pointed back to the Voucher No at the Header block. This is now not being filled in.
Re: When_Validate_Item trigerr [message #176637 is a reply to message #176568] Fri, 09 June 2006 00:57 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why not use the When-Create-Record trigger and populate the new record in there?

David
Re: When_Validate_Item trigerr [message #176789 is a reply to message #176637] Fri, 09 June 2006 10:45 Go to previous message
her_today
Messages: 5
Registered: June 2006
Junior Member
That has fixed my problems, thanks to all for your help.

Previous Topic: host/SQL*Loader oddity
Next Topic: exporting & importing from oracle forms
Goto Forum:
  


Current Time: Fri Sep 20 09:43:02 CDT 2024