Hi there,
I have currently scripted a couple buttons to perform a housekeeping function. Basically you click it to see if any rentals (each record = 1 rental) have not been checked in yet within a specific time frame (today's date and back). It is set to take you to a list of all the records that show a rental has not yet been checked in.
I was wondering if there was a way to have the buttons stay Green (when all rentals are checked in) and to turn red when there are rentals to investigate. Ideally the user would click into the layout and either see a green or red button based on the results of the script.
I figure I could use conditional formatting, but I don't know how to tell the script to run upon entry vs. upon clicking the button. I also don't know what the language used for the 'condition' to know to change color.
Hopefully I make sense.
Thanks
Conditional formatting does not use a script; you identify a condition and then configure what formatting to apply when that condition is true. When you open the Conditional Formatting dialog box, you have the option to configure different types of formatting changes (you would probably want to change the fill color) and then specify the Condition (you would probably use the Formula Is option and specify a formula that evaluates to true when you want the formatting to apply (we would need to know more about the structure of your system to advise you on what formula to use).
If you are adamant about using a script, you could have a script trigger set for OnRecordLoad that would perform a script and set a global variable and then the Conditional Formatting would reference that global variable, however I would recommend pursuing the approach first.