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 Go to next message
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 #81437 is a reply to message #81435] Tue, 18 February 2003 03:20 Go to previous messageGo to next message
magnetic
Messages: 324
Registered: January 2003
Senior Member

you should have 2 blocks of identical items.first block are database items and the second are not database items (wich is often called a control block).
Each block on a seperate view.
depending on condition you should show the correct view
thats all.
Re: How to set the Database Item Property dynamically... [message #81460 is a reply to message #81435] Thu, 20 February 2003 04:35 Go to previous message
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
Previous Topic: Update sequence
Next Topic: Rollback in Forms
Goto Forum:
  


Current Time: Tue Nov 30 11:43:10 CST 2021