Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRM2011 Workflow: What happens if the field which is used in the condition of the workflow is updated after the workflow has started?

Example: Lets say I have a workflow which send an email 2 days before warranty enddate. This workflow is triggered on the "Created" of a entity.

step 1: wait condition - process timeout < (warrantyendate - 2)
     after wait: send email.

So when the record is created, the workflow is started. But what happens when the user goes back and updates the warranty enddate.

Does the workflow check the updated warranty enddate or does it still use the enddate entered when it was triggered (i.e the initial on create value)?

like image 219
Sabrish Ayyappan Balachander Avatar asked Aug 08 '12 15:08

Sabrish Ayyappan Balachander


2 Answers

My understanding is that the workflow uses the data in the system at the time of execution.

The important thing to take note here is that a workflow can be executed many times, at these times the data in the system can be different. Crm caches the state of the workflow, but not the data. Process Architecture for Microsoft Dynamics CRM 2011 describes this.

So, each time the process timeout condition is checked it will use the current value of warrantyEndDate. If the value is changed, next time the condition is checked the new value will be used.

In any case as @BenPatterson1 suggests, you are probably best just testing to be sure.

like image 157
James Wood Avatar answered Oct 23 '22 20:10

James Wood


After trying this myself, if the value of the field included in the condition changes, the workflow engine fires up from sleep(waiting) and checks the condition again.

If it meets the condition, then continues to the next step or will continue to wait.

like image 28
Sabrish Ayyappan Balachander Avatar answered Oct 23 '22 19:10

Sabrish Ayyappan Balachander