workflow fires two times even if i do not change field value in CRM 2011 -
i have workflow in microsoft crm 2011 fires on field change.
when workflow fires, first check boolean value of flag: if value yes set no otherwise if flag value no create "xyz" entity.
my problem is: when change flag value no again fires , create entity "xyz".
it's happening because plugin looping infinitely, triggers on , on again.
you can prevent loop using iexecutioncontext.depth property
http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iexecutioncontext.depth.aspx
ipluginexecutioncontext context = ipluginexecutioncontext)serviceprovider.getservice(typeof(ipluginexecutioncontext)); if (context.depth > 1) { return; }
this cancel plugin when depth deeper 1.
Comments
Post a Comment