Microsoft CRM Workflow
January 13, 2011
Building Workflows with Nested Wait/Timeouts in CRM 4.0
I recently worked with a customer using CRM online. Part of their process was to create authorizations, which needed to be reviewed quarterly relative to the authorization’s start date. They wanted a reminder email sent 1 month prior to that quarterly review.
I created a workflow with these conditions; however, every time I ran the workflow it would only honor the first timeout condition. The other 2 timeout conditions received check marks, but they were ignored otherwise.
Here is a short example of the situation:
As you can see, this workflow was initiated at 8:47pm with a 4 minute timeout. The time in the lower right shows 8:50pm, so it is correcting in a “waiting” state.
Next, you’ll see that it is now 8:53pm and the workflow should be in its 2nd timeout phase until 8:55pm. Instead, it has processed all the way through the workflow.
The workflow will not honor nested timeouts in this format. There are 2 solutions you use to get the workflow to work.
Solution 1 – Use child workflows
In the example above, you will create a child workflow within the “parent” workflow that starts with a timeout condition and then performs an update. See below.
Parent workflow
Child workflow
Also, from a design standpoint, it is better to use child workflows when creating workflows that span many days. This way if you need to ever stop your main workflow, there is much less disruption because child workflows currently working items are not impacted.
Solution 2 – Insert a “no op” step and base the nested timeout on that date/time
The goal here is to insert a step prior to the nested (2nd) timeout which will act as a point of reference against which the nested timeout can fire. A “no op” step is a step, such as an update step, that is in the workflow, but you don’t set it to update anything. Even though it doesn’t update anything, the system thinks it did and so the ‘Modified On’ date is changed. Now you can set your timeout step to timeout x hours, days, etc. from the ‘Modified On’ date & time. Below is an example of how to configure it.
Posted by Chris Weilandt on January 13, 2011 at 11:09 PM in Microsoft CRM Workflow | Permalink | Comments (0) | TrackBack (0)
October 22, 2010
Workflow error: The entity referenced by this workflow includes a currency value that does not exist in your organization.
Problem: I received the error, “The entity referenced by this workflow includes a currency value that does not exist in your organization.”, while trying to publish a workflow I had just exported from my Dev environment and imported into my QA environment. The ‘Lead’ entity is the workflow’s primary entity.
Within this workflow, I was creating a new lead and that is where the problem existed. I clicked ‘Set Properties’ to investigate the Opportunity form. Every field that was a field type of “money” had a red ‘X’ next to it, but I couldn’t do anything to those fields and so the problem persisted.
Solution: There is a field on the ‘Details’ tab named ‘Currency’ (transactioncurrencyid) that is a lookup to a standard entity named ‘Currency’. The association to that lookup was broken when the workflow was imported into the QA environment. You can tell because the text in the text box is red. To correct this, simply click on the lookup icon, look up that entry again, in this case “US Dollar”, and click ‘OK’. The text should now appear in blue. Click ‘Save and Close’ to close the form and ‘Save and Close’ to close the workflow. You should now be able to successfully publish the workflow.
Posted by Chris Weilandt on October 22, 2010 at 04:58 AM in Microsoft CRM Workflow | Permalink | Comments (0) | TrackBack (0)
June 26, 2010
Plug-Ins vs. Workflows
This is a very common question from users, and this post does a great job of clarifying when each approach is appropriate.
Also check out this matrix comparing workfows vs. Plugins: http://blogs.msdn.com/b/lezamax/archive/2008/04/02/plug-in-or-workflow.aspx
Posted by Joel Lindstrom on June 26, 2010 at 10:19 PM in Microsoft CRM Customizations, Microsoft CRM Workflow | Permalink | Comments (0) | TrackBack (0)
May 23, 2010
Workflow Deadlock Issue Solved
I am really impressed with Microsoft Dynamics CRM Update Rollup 10. First, it solved an issue we saw with synchronization errors when using shared calendars. It also fixes a workflow issue.
This issue can happen when you have a workflow with a send workflow step, such as a notification workflow. Sometimes when you generate multiple instances of the workflow simultaneously, some of them can fail due to deadlocking.
You can read more about this fix in Microsoft KB article 981053.
Posted by Joel Lindstrom on May 23, 2010 at 04:10 PM in Microsoft CRM Workflow | Permalink | Comments (0) | TrackBack (0)




Recent Comments