Home » Developer & Programmer » Forms » Which Trigger and What Level? (Forms 6i)
Which Trigger and What Level? [message #290400] Fri, 28 December 2007 13:08 Go to next message
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 #290412 is a reply to message #290400] Fri, 28 December 2007 14:59 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, if you need to enable/disable items in those records, do that in PRE-RECORD and POST-RECORD triggers.
Re: Which Trigger and What Level? [message #290630 is a reply to message #290412] Sun, 30 December 2007 22:44 Go to previous messageGo to next message
mintomohan
Messages: 104
Registered: November 2006
Location: India
Senior Member
i think you can also use the trigger WHEN-NEW-RECORD-INSTANCE trigger of the data block.

Minto
Re: Which Trigger and What Level? [message #290977 is a reply to message #290400] Wed, 02 January 2008 08:00 Go to previous messageGo to next message
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 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT 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
Previous Topic: Go_item is not working
Next Topic: Upgradation steps required from 6i to 10g
Goto Forum:
  


Current Time: Fri Dec 02 14:21:05 CST 2016

Total time taken to generate the page: 0.14602 seconds