Posts

Showing posts with the label QualifyLead Message

Modify Lead Qualification process in Dynamics CRM using C#: How to prevent Opportunity/ Account Creation and Refresh Lead Page On Lead Qualify

One condition on Lead Qualify could be like: If we don't want to create Opportunit/ Account or Contact on Lead Qualification that heppens by default. So for this secnario Below is the code which is required to stop creation of Opportunity/ Account on Qualifying Lead. Note: Register Plugin on "QualifyLead" message and Pre-Operation public void Execute(IServiceProvider serviceProvider)        {        AvoidOpportunityCreationOnLeadQualify(serviceProvider);      }        private void AvoidOpportunityCreationOnLeadQualify(IServiceProvider serviceProvider)      {        IPluginExecutionContext contextPlugin = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));        IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));     ...

How to Get the records when Lead is Qualified in Microsoft Dynamics CRM using Plugin C#

Image
In this blog I am going to explain and show an example when a lead is Qualified then how we can get the new records or we can update records in newly created record when Lead status is Qualified. 1. Register your created plugin in "QualifyLead" message and On Post-Operation to get the records when lead is Qualified. :: 2. Here in this example I am setting up a Lookup field value in newly created Opportunity when lead is Qualified. Just type the code as below and register as said in Step 1.       IOrganizationService serviceDefaultUser = null;             IPluginExecutionContext contextPlugin = GetContext(serviceProvider);             serviceDefaultUser = GetServiceObject(serviceProvider, contextPlugin);             // Get the qualified lead.             EntityReference leadid = (EntityReference)context.InputParameters["LeadId"];  ...
go to top image