Thursday, November 20, 2008

CRM 4 - Prevent workflow execution

In order to prevent workflow execution, you can intercept the CRM logic by writing your own plug-in for  asyncoperation/create/pre. Within your plug-in you can apply your custom logic to decide whether the asyncoperation is a workflow and if this workflow should not be run and therefore not appear in the workflow instance list. Unfortunately you have to throw an exception to make this happen. Within you systemjobs you'll find a failed workflow expansion task.

In order to allow a plug-ing for create on asyncoperation you have to run the following SQL-statement:

update sdkmessagefilter
set IsCustomProcessingStepAllowed = 1
where sdkmessageid in (
select sdkmessageid
from sdkmessage
where name = 'Create')
and primaryobjecttypecode = 4700

0 comments: