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
Lenay CoulterLenay Coulter 

Coding

I want to create a reoccuring task for my contacts every three weeks forever, what is the coding for this? 
Victor AbrahamVictor Abraham
You can write a batch class on contact object, which wil get all tasks under the contact and create recurring tasks with frequency of three weeks if there is not such task already.
For future contacts, you can copy this logic to a trigger in contact or schedule this batch class for every day.
Rahul SharmaRahul Sharma
Lenay, I guess you can simply write a summary report on Contact with the recurring task.
And then schedule report refresh and email to the users.

Not sure if it works for your case, but is a good option to look at!
Always ThinkinAlways Thinkin
Do you want all reoccuring Tasks created at the same time, or do you want a new one created when the previous one is completed? The second option is easier and more scalable from a data storage perspective; you can create a simple after update trigger that creates a new Task when the previous one is completed. The first option would create hundreds of Tasks for every Contact, so you could quickly get into 100s of thousands of Tasks which will make reporting difficult.
Always ThinkinAlways Thinkin
Another option could be to create a Time-Based Workflow Task on Contact although there is a limit to how many it will let you create. This would have the benefit that it only creates the new Tasks every 3 weeks so there would not be a lot of future Tasks in the database.
Always ThinkinAlways Thinkin
And yet another option is to use Workato which unlike Salesforce has a schedule component tha tyou can set to run periodically and perform actions against Salesforce. See this blog article for an example: http://www.venntechnology.com/scheduled-actions-in-salesforce/