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
catharsis50catharsis50 

Help writing a trigger to use value from a custom object

I have a custom object that populates of this formula:

IF( StartDate > Today(),'Pending', 
IF(EndDate < Today(), 'Completed', 
IF(OR(StartDate < Today(),EndDate < Today()), 'In Progress', null 


)

 

I would like to create a trigger to populate the Campaign Status standard field with that value once daily after midnight so the status is updated. Is this possible how would I go about it. 

 

Thank you!

AmitSahuAmitSahu
Write times based workflow... or schedule apex class