Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Disable All the steps in a Plug

$
0
0

Hi,

I am trying to disable all the plug-in steps under a plug-in because of one processing scenario. I am able to disable individually but I want to disable all the steps under the plug-in with one call. Is there any better approach other than below one. Below one is just a sample code to disable one step similar way I want to disable all the steps under that plug-in.

var qe = newQueryExpression("sdkmessageprocessingstep");

qe.ColumnSet.AddColumns("sdkmessageprocessingstepid", "name");

var step = orgService.RetrieveMultiple(qe).Entities.Where(x => x.Attributes["name"].ToString().Contains(pluginName)).First();

//Trying to retrieve but not sure how to update all the steps under this Step1 using one call

//var step1 = orgService.RetrieveMultiple(qe).Entities.Where(x => x.Attributes["name"].ToString().Contains(pluginName));

var pluginId = (Guid)step.Attributes["sdkmessageprocessingstepid"];

int pluginStateCode = enable ? 0 : 1;

int pluginStatusCode = enable ? 1 : 2;

orgService.Execute(newSetStateRequest

{

EntityMoniker = newEntityReference("sdkmessageprocessingstep", pluginId),

State = newOptionSetValue(pluginStateCode),

Status = newOptionSetValue(pluginStatusCode)

});


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>