Which Trigger and What Level? [message #290400] |
Fri, 28 December 2007 13:08  |
Steve Corey
Messages: 336 Registered: February 2005 Location: RI
|
Senior Member |
|
|
What trigger fires when the user cycles from record to record in a single block form?
Example:
When user cycles through records (using next_record bound key) I need to set enabled/disabled property of certain text items in the form.
How can I achieve this?
Thanks,
Steve
|
|
|
|
|
Re: Which Trigger and What Level? [message #290977 is a reply to message #290400] |
Wed, 02 January 2008 08:00   |
Steve Corey
Messages: 336 Registered: February 2005 Location: RI
|
Senior Member |
|
|
Littlefoot and Minto -
Thank you very much for your replies.
The Pre-Record trigger at the block-level is executing perfectly.
One thing to remember, at least when developing using Forms 6i, when you want to enable and disable block level items dependant on certain values you HAVE TO SET the enabled property AND the navigable property, otherwise the form will not function properly. This has been my experience, I'm not sure if anyone else can confirm or deny, but I have seen this in many situations.
Take the following example:
DECLARE
v_rec_end_date DATE;
BEGIN
v_rec_end_date := :SOME_BLOCK.SOME_ITEM_VALUE;
IF v_rec_end_date = to_date('04-FEB-2006', 'DD-MON-RRRR') THEN
SET_ITEM_PROPERTY('CONTROLBLOCK.item_to_enable1', ENABLED, PROPERTY_TRUE);
SET_ITEM_PROPERTY('CONTROLBLOCK.item_to_enable1', NAVIGABLE, PROPERTY_TRUE);
ELSE
SET_ITEM_PROPERTY('CONTROLBLOCK.item_to_enable1', NAVIGABLE, PROPERTY_FALSE);
SET_ITEM_PROPERTY('CONTROLBLOCK.item_to_enable1', ENABLED, PROPERTY_FALSE);
END IF;
END;
Unless you have the NAVIGABLE property being controlled in addition to the ENABLED property you will not achieve the "turning on and turning off" of certain form items.
Thanks for your help guys!
Regards,
Steve
|
|
|
Re: Which Trigger and What Level? [message #291831 is a reply to message #290977] |
Mon, 07 January 2008 00:26  |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Remember that if the item was updateable then you have to set it back 'on' after you re-enable the field.
Its in the documentation.
David
|
|
|