Home » Developer & Programmer » Forms » How to set the Database Item Property dynamically...
How to set the Database Item Property dynamically... [message #81435] |
Tue, 18 February 2003 02:31  |
Mitesh Vijayvargiy
Messages: 3 Registered: February 2003
|
Junior Member |
|
|
Hi,
I am facing a problem wherein I have a requirement to display a set of fields in one case and another set of fields at same layout in another case... this could be done by dynamically setting the Database Item Property....
But there is no defined property in the SET_ITEM_PROPERTY to do this...
Pls let me know whether this thing is possible and how....
Request to give the solution as earliest...
Thanks in advance,
Mitesh V.
|
|
|
|
Re: How to set the Database Item Property dynamically... [message #81460 is a reply to message #81435] |
Thu, 20 February 2003 04:35  |
Paul
Messages: 164 Registered: April 1999
|
Senior Member |
|
|
You can also do this in a single block. Forms allows you to place 2 (or more) items in the same physical location on a single canvas, then use code something like this in a trigger:
BEGIN
IF USER = 'USER1' THEN
SET_ITEM_PROPERTY('BLK.ITM1',VISIBLE,PROPERTY_TRUE);
SET_ITEM_PROPERTY('BLK.ITM1',ENABLED,PROPERTY_TRUE);
SET_ITEM_PROPERTY('BLK.ITM2',VISIBLE,PROPERTY_FALSE);
ELSE
SET_ITEM_PROPERTY('BLK.ITM1',VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('BLK.ITM2',VISIBLE,PROPERTY_TRUE);
SET_ITEM_PROPERTY('BLK.ITM2',ENABLED,PROPERTY_TRUE);
END IF;
END;
The trigger you use to do this would be dependent on the condition you want to cause the change. In the example above, a WHEN-NEW-FORM-INSTANCE trigger would be appropriate. You can also adjust the physical location by SETTING the item's X_POS and/or Y_POS values in the same manner.
Hope this helps,
Paul
|
|
|
Goto Forum:
Current Time: Sat Mar 01 02:40:24 CST 2025
|