Button Color based on Script results

Discussion created by BERGSTEN on Sep 28, 2017
Latest reply on Sep 28, 2017 by philmodjunk

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.