Wednesday, October 25, 2006

MSCRM Workflow
I am working on a demo and wanted to create a couple workflow processes to assign a new opportunity, and then fire a new sales process. So the first rule was a rule on the opportunity firing OnCreate and its tasks were:

When a new opportunity is created, assign it to Gail, our sales rep
Send Gail an email to alert her to her new opportunity

I also created a Sales Process to fire from the OnCreate event for the opportunity to carry out a number of steps. However due to the asynchronous nature of the MSCRM workflow engine, this refused to work. The first task in the sales process would not create, and when I checked the workflow monitor I noticed it paused, and if I clicked “retry” it would complete. This makes sense, I think the issue is that the sales process was firing and trying to create new tasks for the owner of the opportunity, but the opportunity had not been assigned by the previous rule yet.

So to solve this I changed the Sales Process to a manual rule, and then in the rule that fires OnCreate I put in a 1 minute wait timer, and then called the sales process as a sub process. Bingo, problem solved.

No comments: