Loading

Retroactively trigger workflow on current records

Data pubblicazione: Dec 26, 2023
Descrizione

To retroactively run workflow rules on the already existing record the evaluation criteria must be considered:


1. Evaluate the rule when a record is created.

2. Evaluate the rule when a record is created, and every time it's edited.

3. Evaluate the rules when a record is created, and every time it's edited to subsequently meet the criteria.


Please note that workflow rules do not automatically fire for existing records. The option to Allow Workflow Rules to Apply Retroactively is still an idea.
 

See also:

Risoluzione


Condition 1: Evaluate the rule when a record is created.


This does not allow for the workflow rule to run on any existing records it only works on new records.

 

Condition 2: Evaluate the rule when a record is created, and every time it's edited.


1. Ensure that the workflow rule is active.

2. Export a report (as a CSV) with just Ids of the records on which you want to run the workflow rule.

3. Open the CSV with Excel to ensure that there are no other lines other than the Ids and the Column title (no header and footer).

4. Perform an Update with the Data Loader (or any other API tool), and map only the Id of each record.
 
Impact: Last Modified Date changes to the date/time of the mass update. Otherwise, no changes other than those made by workflow as intended.
 

Condition 3: Evaluate the rule when a record is created, and every time it's edited to subsequently meet the criteria.


1. Ensure that the workflow rule is active.

2. Create a checkbox field on the record, default checked.

3. Reference (temporarily; just to Retroactive) the checkbox in the workflow criteria: checkbox EQUALS true

4. Export a report (as a CSV) with just Ids of the records on which you want to run the workflow rule.

5. Open the CSV with Excel, Add a new column: the Title (first row) should be "checkbox" and all of the values should be "1" (no quotes) next to each Id in the list.

6. Ensure that there are no other lines other than the Ids and the Column title (no header and footer).

7. Perform an Update with the Data Loader (or any other API tool), and map the Id and Checkbox fields (to the new checkbox field created in step 2).

8. Remove the reference to the checkbox in the Workflow Criteria.

9. Delete the checkbox.

Impact: Last Modified Date changes to the date/time of the mass update.  Technically, no other changes would be made other than those made by workflow, but see below note on how time triggers would be executed:

 

Notes on Workflow Time Triggers on Existing Records


When a workflow is evaluated, all of the actions/time triggers are scheduled for their appointed time (unless the record is edited to be disqualified before a particular time trigger fires). This includes when the appointed time is in the past. If the appointed time is in the past, and the workflow fires, then the time trigger will fire in the next batch a few minutes later.  

Here's an example:

We have a workflow on Contract that sends an email to the customer 60 days, 30 days, and 5 days before the Contract Expiration Date (3 time triggers configured this way).

If we run the workflow rule on a record whose Expiration Date is 15 days from now, then the emails for 60 days and 30 days before the Expiration Date (which, ideally, should have triggered 45 days and 15 days ago, had the workflow existed) will be sent out a few minutes after the workflow rule was run on the record. The only way to individually control individual time triggers is to create them on individual workflow rules.
Numero articolo Knowledge

000386750

 
Caricamento
Salesforce Help | Article