I've following code snippet in which I am trying to get current order id. But it throw exception, following is the exception and plugin step. Can anyone please guide what went wrong in it?
IPluginExecutionContext context = (IPluginExecutionContext)isp.GetService(typeof (IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory)isp.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = factory.CreateOrganizationService(context.UserId); Entity entity = null; entity = (Entity)context.InputParameters["Target"]; Guid orderId = entity.Id;
*This post is locked for comments