How to make one field dependent on another [message #554002] |
Wed, 09 May 2012 12:19 |
knsreedevi
Messages: 25 Registered: May 2012 Location: Bangalore
|
Junior Member |
|
|
Hi All,
I have 2 fields say FieldA and FieldB which is dependent on FieldA.
The logic is If FieldA is NULL then FieldB should be NULL
If FieldA is not NULL then FieldB should be not NULL.
I have written the following code in the WHEN-VALIDATE-ITEM trigger of FieldA
if :BLOCK_NAME.FieldA is not null then
set_item_property('BLOCK_NAME.FieldB', REQUIRED, PROPERTY_TRUE);
end if;
This makes the FieldB mandatory (color changes to yellow) when I tab out of FieldA, but if I save the record without any value for FieldB, it gets saved without any errors.
Any help is appreciated.
|
|
|
Re: How to make one field dependent on another [message #554003 is a reply to message #554002] |
Wed, 09 May 2012 12:49 |
Dave199
Messages: 2 Registered: May 2012 Location: US
|
Junior Member |
|
|
Try the following:
I have tried something like this on "ON-VALIDATE-FIELD" trigger and it worked in R12/Forms 10g.
Which version are you working on?
set_item_property('BLOCK_NAME.FieldB', REQUIRED, PROPERTY_TRUE);
fnd_message.set_string('Please Enter value for FieldB.');
fnd_message.show;
Bell;
raise form_trigger_failure;
|
|
|
|