Workflow Value Change Detection - Part 1
Monday, March 17, 2008 at 02:27AM One of the things you might want to do with CRM Workflow is have a workflow wait for a value to change.
For example, maybe there’s a business process you want to happen every time a company changes their name. The most obvious way you might do this is using a wait for as you can see below
WaitFor Account.name != {account.name}
The problem with this approach might surprise you. If you were to run a workflow instance that had the above Wait for condition it would run for ever.
The reason is because each time a workflow wakes up after a Waitfor condition it will pull the current values for the primary and related entities that are used in the workflow. So in our example if Account.Name started out as “Old Name” the workflow would stop and register a wait subscription for a change on the account entity instance in question. When that specific record is updated for any reason (Not just the value in the WaitFor condition) the CRM workflow engine will wake up the workflow instance so it can evaluate it's Waitfor condition. The evaluation though is done using current values for Account.Name so Account.Name != {Account.Name} will always be false.
Stay tuned for upcoming posts on a couple possible ways you can resolve this. One of them we will look at doing it without doing any coding , and the other we will use a couple of custom activities.

Reader Comments