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

Need help writing a trigger

Can someone point me in the right direction for writing a trigger that updates a field on the Account Record if a contract is expired?  


For instance if a contract is current (start and end date are within current date) it would update the field to say current.  If the contract end date is a date in the past and there are no other current contracts it would update the field to "lapsed"


Thanks in advance 





Dont you mean  update a field to current when current date is within start and end dates :)

Anyways, are start, end dates fields of contact? Custom fields ?

You can only apply triggers to events like when a contact is created/updates/deleted.

You cannot schedule a trigger.






Hi Arunk ,


Contract Start and End Date are standard fields in the contract object 


we can schedule a trigger by using time trigger


Hi Pragadheeshwari,


Do you know of any example anywhere?  I'm very new to triggers.  Thanks