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
Pankaj PariharPankaj Parihar 

trigger 4

hello
plz help me in this trigger code

If owner of an Account has gone on leave for more than 90 days then type field should be updated with "Former Client".
If owner of an Account has gone on leave for more than 180 days and if the owner has a delegated user then the delegated user should be updated as Owner.
If owner of an Account has gone on leave for more than 180 days and if the owner has no delegated user then type field should be updated with "Deactivated".
IGNACIO SARMIENTO LOSADA1IGNACIO SARMIENTO LOSADA1
Hi Pankaj,

I guess the best solution is to create a ' Time-Based Workflow Action' instead of a trigger.  
https://help.salesforce.com/articleView?id=000005245&type=1

Please mark this as solved if it's resolved and mark as the best answer

Thanks,
Ignacio
Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri
Do you already have a field to calculate leave days ?
IGNACIO SARMIENTO LOSADA1IGNACIO SARMIENTO LOSADA1
Yes. Firstly, you have to create a workflow. Secondly, inside this workflow, you can create a time based workflow. When the the workflow validation criteria is found, check Setup -> Time based workflow There you can setup a filter to know the time that remains to trigger the workflow Let me know if you understand Obtener Outlook para Android