change records visual attribute depending on certain conditions [message #515658] |
Tue, 12 July 2011 13:35  |
 |
aaichah
Messages: 24 Registered: July 2011 Location: Ottawa
|
Junior Member |
|
|
CM: 2 merged
hi,
I have a database block that refreshes using a timer.
In short, I list all open work pieces for a certain garage, displaying route, run, on_time, of_time, location grouped by garage, on_time, off_time
I need to highlight every garage with a different color
I am highlighting the on_time everytime the garage changes.
The problem is, everytime I move down the records, instead of keeping the previous garage color, and highlight the new garage on_time with a new color, the whole on_time colomun will be set to the current garage color.
I need to break down the block by color so the user can distinguish between the different garages, and the start and end time.
Here is my code, I am putting it in when_new_record_instance of the work_block:
IF :work_bLock.current_garage = 9006 THEN
Set_Item_Property('work_block.on_time', BACKGROUND_COLOR, 'r191g223b191');
ELSIF :work_bLock.current_garage = 9002 THEN
Set_Item_Property('work_block.on_time', BACKGROUND_COLOR, 'r255g228b196');
ELSE
Set_Item_Property('work_block.on_time', BACKGROUND_COLOR, 'r255g250b250');
END IF;
I need the block to be 3 or more different colors depending on the garage
Can this be done at run time?
Thank you
[Updated on: Tue, 12 July 2011 14:07] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: change records visual attribute depending on certain conditions [message #661220 is a reply to message #661217] |
Sat, 11 March 2017 01:38  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
As you were already told: PRE-RECORD and POST-RECORD triggers are the ones to be used. In PRE-RECORD set visual attributes of the records you are navigating to (for example, make the items pink). In POST-RECORD, which fires when you're navigating out of that record, set them back to "default" state (for example, white).
|
|
|