Automatic field entries in forms [message #80080] |
Fri, 09 August 2002 09:34 |
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 #80086 is a reply to message #80084] |
Fri, 09 August 2002 13:36 |
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 |
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
|
|
|