Home » Developer & Programmer » Forms » set_item_instance_property for null records in Multiple Record Block
|
Re: set_item_instance_property for null records in Multiple Record Block [message #253132 is a reply to message #250703] |
Sun, 22 July 2007 21:20   |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
When a Forms screen displays 16 rows only the uppermost 'blank' row is actually 'active', all the others are just screen filler.
If you want to turn fields 'on' and 'off' depending on information in a row then use 'set_item_property(enterable)' in the 'when-new-record-instance' trigger (read the doco for the 'when-create-record' trigger so that you understand the differences between these two triggers).
Forms is a block mode environment. It is not VB. Looping is not a common method of doing things in an Oracle Form.
David
Oops. I said 'set_item_property', I meant 'set_item_instance_property'.
[Updated on: Thu, 15 November 2007 18:11] Report message to a moderator
|
|
|
Re: set_item_instance_property for null records in Multiple Record Block [message #279910 is a reply to message #250703] |
Sun, 11 November 2007 13:49  |
sblindgren
Messages: 4 Registered: June 2007 Location: Salt Lake City, Utah
|
Junior Member |
|
|
I was able to pull this one off and thought I would share with everybody else so if they had the need, they would know how I did it.
First, for the Miles and Hours columns in the multiple record block I set them as off (the Problem I had is that I had them on and was trying to set them off), then in the Post_Query trigger on the block, I looked at the column that was determining if it were Miles or Hours being tracked. Based on that criteria, I executed the following code:
IF :BLK_DISPLAY.METER_TYPE_ID = 'H' THEN
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,VISUAL_ATTRIBUTE,'VA_DISPLAY_ONLY');
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,NAVIGABLE,PROPERTY_FALSE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,VISUAL_ATTRIBUTE,'VA_UPDATE');
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,NAVIGABLE,PROPERTY_TRUE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_TRUE);
ELSIF :BLK_DISPLAY.METER_TYPE_ID = 'M' THEN
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,VISUAL_ATTRIBUTE,'VA_UPDATE');
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,NAVIGABLE,PROPERTY_TRUE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.MILES',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_TRUE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,VISUAL_ATTRIBUTE,'VA_DISPLAY_ONLY');
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,NAVIGABLE,PROPERTY_FALSE);
SET_ITEM_INSTANCE_PROPERTY('BLK_DISPLAY.HOURS',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
END IF;
I'm hopeful that this helps someone else out, it wasn't easy, but it works great and the client is very happy with the results.
Regards,
Scott Lindgren
|
|
|
Goto Forum:
Current Time: Wed Mar 12 21:00:20 CDT 2025
|