Notifications
Announcements
No record found.
Hello team,
Is there any way to disable a plugin programetically other then using PRT ?
Before running upgrade scripts I want to disable plugins programetically and run scripts and then enable them after upgrade scripts are executed. Is there any way to do so ?
Thank you!
Hi,
Use below code to disable plugin steps programatically.
public static void UpdateStepStatus(CrmOrganization org, Guid stepId, bool isEnable) { if (org == null) { throw new ArgumentNullException("org"); } else if (stepId == Guid.Empty) { throw new ArgumentException("Invalid Guid", "stepId"); } SetStateSdkMessageProcessingStepRequest request = new SetStateSdkMessageProcessingStepRequest(); request.EntityId = stepId; if (isEnable) { request.SdkMessageProcessingStepState = SdkMessageProcessingStepState.Enabled; } else { request.SdkMessageProcessingStepState = SdkMessageProcessingStepState.Disabled; } request.SdkMessageProcessingStepStatus = -1; org.CrmService.Execute(request); return; }
See below link
https://social.microsoft.com/Forums/en-US/53b93133-4999-44f2-8f49-0d736ac2763a/programmatically-disabling-the-plugin-step?forum=crmdevelopment
Hi Sangeeta,
Hope you are doing well.
It seems that https://docs.microsoft.com/en-us/previous-versions/dynamics-crm4/developers-guide/bb958096%28v%3dmsdn.10%29 is not supported in current version but we can use another method mentioned in below document:
https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/119022/dynamically-programatically-enable-disable-plugin?pifragment-97030=1
Please help to review the answer given in above document and let us know if any issue. Please help to mark my answer as verified if you are able to solve your problem. Thank you.
Best Regards,
Mobeen Mohsin
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 108 Super User 2025 Season 2
Jimmy Passeti 50 Most Valuable Professional
Gerardo RenterÃa Ga... 49 Most Valuable Professional