Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

MS CRM 2013 Plugin issue

$
0
0

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.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>