Home » Developer & Programmer » Forms » Automatic field entries in forms
Automatic field entries in forms [message #80080] Fri, 09 August 2002 09:34 Go to next message
Ed
Messages: 24
Registered: November 1999
Junior Member
I'm trying to have a description field in my form filled in automatically when its corresponding code is entered. They way I've tried to do this is with the following code, on a WHEN-NEW-RECORD-INSTACE block level trigger:

IF ( (:WHSDGVW.WHSSTDG_CODE is not null) ) THEN

IF :WHSDGVW.WHSDIAG_DESCRIPTION IS NULL AND :WHSDGVW.WHSSTDG_CODE = :WHSDIAG.WHSDIAG_CODE THEN
:WHSDGVW.WHSDIAG_DESCRIPTION := :WHSDIAG.WHSDIAG_DESCRIPTION;
END IF;
END IF;

which hasn't worked. Any ideas?
Re: Automatic field entries in forms [message #80084 is a reply to message #80080] Fri, 09 August 2002 13:14 Go to previous messageGo to next message
Tyler
Messages: 123
Registered: January 2002
Senior Member
Why can't you just build a master detail and execute query? (if I understand your problem correctly)
Re: Automatic field entries in forms [message #80086 is a reply to message #80084] Fri, 09 August 2002 13:36 Go to previous messageGo to next message
Ed
Messages: 24
Registered: November 1999
Junior Member
I've already built a master detail, and all fields get filled in on execute query - for already existing records. For new records, I would like the corresponding description to be automatically entered in the empty field when a code is entered. What I'm messing with now is LOVs, which insert into the code and description field the code and respective description, but the problem I run into is that the LOV is invoked even for already existing records. I'm trying to find a way to invoke the LOV only when a new record is being created. I'm thinking of using a when new record instance block-level trigger to invoke the LOV - haven't figured this out yet. Any ideas? Thanks.
Re: Automatic field entries in forms [message #80091 is a reply to message #80080] Sat, 10 August 2002 00:03 Go to previous message
Tejpal Saraswat
Messages: 22
Registered: August 2002
Junior Member
Hi Ed
1st thing u should not put the code on the block level b'coz u r entering or displaying on the record level.
So put the same code on an appropriate trigger like When-Validate-Item on ur code item , when u r entering the Record , and also put the code or (Select Statement ) to display the description on the Block Level Post-Query trigger when u r querying the data.

best regds
Tej
Previous Topic: Running a report on a form
Next Topic: Installation Problem.....
Goto Forum:
  


Current Time: Fri Apr 26 20:58:44 CDT 2024