function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OleGoRulesOleGoRules 

Reset a formula field end of every year

Hey guys, I have created a formula field to reflect the activity status with an LED. The formula works, but I would like LED to reset to red at the end of every year. Any help would be highly appreciated.

Last Activity is a custom field that captures the SF modified date on Booked__c, Events__c and In_Person__c are all custom number fields.  

Data TypeFormula  
IF(Last_Activity__c = null, IMAGE('/img/samples/light_red.gif','Red'),  IF( Booked__c >= 1, IMAGE('/img/samples/light_green.gif','Green'),  IF(  OR(In_Person__c >=1, Events_Attended__c >=1),  IMAGE('/img/samples/light_yellow.gif','Yellow'),  IF(  OR((In_Person__c >=1), (Events_Attended__c >=1), AND(Booked__c >= 1)),  IMAGE('/img/samples/light_green.gif','Green'),  IMAGE('/img/samples/light_red.gif','Red')  )  )  )  )
RD@SFRD@SF
Hi Oleg,

You can write a process using process builder to trigger on the date field, create a date field called "LED reset date" populate it with 31/12/yearof today, to set the Last_Activity__c as null. Which in turn update the LED image.

Hope it helps
RD