Showing posts with label SdkMessageProcessingStepMode. Show all posts
Showing posts with label SdkMessageProcessingStepMode. Show all posts

Thursday, 26 January 2017

MS CRM - How to find a plugin is synchronous or Asynchronous - SdkMessageProcessingStepMode

At times, we may need to find whether the current plugin step is executing synchronous or asynchronous via code.

We can use the property called mode in IPluginExecutionContext to identify the same.

Code snippet:
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
if(context.Mode == SdkMessageProcessingStepMode.Asynchronous)