Hi All
Plugin Inputparameter context not working. Code is below.
IPluginExecutionContext context =(IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory serviceFactory =(IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
throw new InvalidPluginExecutionException("work");
}
else { throw new InvalidPluginExecutionException("not work"); }
going to else condition i.e,. "not work".
I have registered plugin on 'QualifyLead' message for Lead entity at pre-validation stage.
and throw new exception is also not working.
Please Help.