Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting color of items

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
Using developer 6i, how can I have an object's color attribute change at runtime based on changes of the data. For example, If I retrieve an employee file and the employee is inactive, I want the name to be highlited RED, if the employee is active I want it to be green etc... I know I need a trigger in a couple of places but I dont know the pl/sql to change the color settings.

thanks for any help..
 
Use SET_ITEM_INSTANCE_PROPERTY in a POST-QUERY trigger.
 
thanks, as usual, I would never have figured out where to begin looking without help...
 
Setting the color will only work well when 1 row is displayed on the form. If you have a multi-row block, then the entire column will be set to the color of the last SET_ITEM_PROPERTY.

By placing the code in the POST-QUERY then the column color reflects the status of the last queried employee.

If this is a single-row block where you allow the user to move from record to record (NEXT_RECORD/PREVIOUS_RECORD) then you might want to use the ON-NEW-RECORD-INSTANCE trigger instead.
 
SET_ITEM_INSTANCE_PROPERTY only affects a single row in a multi row block. Try this in POST-QUERY

SET_ITEM_INSTANCE_PROPERTY('block.item',To_Number:)SYSTEM.TRIGGER_RECORD),VISUAL_ATTRIBUTE,'your visual attribute');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top