简体   繁体   中英

Delete plugin and steps in code (Dynamics CRM 2013)

Without using the plugin registration tool or the CRM customizations form, how can you delete SDK message steps?

Is this possible in code using the XRM SDK. Also can plugins be deleted in code?

To get all the steps:

var step = xrmServiceContext.SdkMessageSet.FirstOrDefault(step => step.Name == "foobar");

To get all the plugin assemblies:

var plugin = xrmServiceContext.PluginAssemblySet.FirstOrDefault(p => p.Name == "foobar");

Once you get the GUIDs you would delete them like any other entity:

service.Delete(PluginAssembly.EntityLogicalName, plugin.Id);

If there are any dependencies, you would need to traverse up the dependency list and delete them first. Use RetrieveDependentComponentsRequest to fetch a list of all dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM