Home » Developer & Programmer » Forms » Change the color of record base on condition (10G)
Change the color of record base on condition [message #335301] Mon, 21 July 2008 15:09 Go to next message
Messages: 37
Registered: July 2008

I developed an oracle form and I would like to change the color of each record base some condition. I know I need to use set_item_instance_property and I am using some thing like this:

set_item_instance_property('MH_ID', current_record, visual_attribute, 'Gray_BG');

But I get FRM-41011 and I know that because I did not define visual_attribute correctly. Please help me about this and tell me how can I define visual_attribute and if it is possible send sample code for that.

Thank you in advance
Re: Change the color of record base on condition [message #335953 is a reply to message #335301] Thu, 24 July 2008 04:39 Go to previous messageGo to next message
Messages: 66
Registered: March 2008
Location: Chennai
There is no specific code for creating visual attribute . In your form module , Just double click on the visual attributes module, visual attribute will be created with default name and setting. Go to the property palette of the VA and set the back ground color or font color as you would like.

then use it like
set_item_instance_property('MH_ID', current_record, visual_attribute, 'VA' );

Re: Change the color of record base on condition [message #336012 is a reply to message #335301] Thu, 24 July 2008 07:07 Go to previous message
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Don't forget that set_item_instance_property will change the property of only 1 item, not the record. So your first parameter should be something like 'block.item' and not 'MH_ID'.
If you want to change the Visual Attribute of all item in the record, you will have to loop on each item and change the property for each of them.

You can use code like this to do that

  cur_itm VARCHAR2(80);
  cur_block VARCHAR2(80) := :System.Cursor_Block; 
  cur_itm := Get_Block_Property( cur_block, FIRST_ITEM ); 
  WHILE ( cur_itm IS NOT NULL ) 
    cur_itm := cur_block||'.'||cur_itm;
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM ); 

Previous Topic: form prob
Next Topic: Developer Suite Installation issue
Goto Forum:

Current Time: Tue Oct 25 00:39:35 CDT 2016

Total time taken to generate the page: 0.05644 seconds