1

How do I make a task recur based on the day it was marked complete?

There is a required field for creating a recurring task: RecurrenceRegeneratedType. I know from creating a task with the standard task workflow that to make a task that recurs based on the due date you use RecurrenceRegenerateAfterDueDate.

I want to make a task recur based on the day it was marked complete. I can't find anywhere in the documentation (or any answers here or on developer.salesforce) explaining what value to use for that.

I know that I need

new Task(...,RecurrenceRegeneratedType='<something??>',...)

But what should that <something??> be?

1 Answer 1

3

The value for making a task recur based on the date it is completed is 'RecurrenceRegenerateAfterToday'

In the release notes for Spring '14 it is explained that there are four kinds of recurrence.

Task Added a field, RecurrenceRegeneratedType, that represents what triggers a repeating task to repeat. Add this field to a page layout together with the RecurrenceInterval field, which determines the number of days between the trigger (due date or close date) and the due date of the next repeating task. The RecurrenceRegeneratedType field has the following picklist values:

None: The task doesn’t repeat.

After due date: The next repeating task will be due the specified number of days after the current task’s due date.

After date completed: The next repeating task will be due the specified number of days after the current task is closed.

(Task closed): This task, now closed, was opened as part of a repeating series. You can use this field to distinguish repeating tasks from other types of tasks for tracking purposes.

Unfortunately, it doesn't say what the values are for those, so I've added them here (I got the values by using Schema in Apex):

  • None: null
  • After due date: 'RecurrenceRegenerateAfterDueDate'
  • After date completed: 'RecurrenceRegenerateAfterToday'
  • (Task closed): 'RecurrenceRegenerated'

A note about 'RecurrenceRegeneratedAfterDueDate': If the due date is more than RecurrenceInterval days in the past, it adds RecurrenceInterval days until it gets to the future. So, for instance if you

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .