Customer Engagement & Dynamics CRM Forum

 View Only
  • 1.  Force Account/Contact Creation on Lead Qualification?

    SILVER CONTRIBUTOR
    Posted Dec 15, 2022 04:47 PM
    Not sure if this is a training issue or if it can be solved programmatically. 

    Our users have the option to create an Opportunity upon Lead qualification, which we want them to have. However, we have several users who change Account/Contact to No and Opportunity to Yes, and then an Opportunity is created without an Account, causing problems.

    I have instructed users not to do this, but it happens at least once a week, often more.

    Is there a way to prevent them from changing the Account/Contact options to No in the Lead Qualification popup? Or do I just need to be more diligent about training and correcting?

    Thanks!

    ------------------------------
    Autumn Hearne
    Associate
    Pinion Global (formerly KCoe Isom)
    ------------------------------


  • 2.  RE: Force Account/Contact Creation on Lead Qualification?

    Posted Dec 16, 2022 06:46 AM
    Hi Autumn, 

    I believe it's not possible to prevent changing options on the qualification screen, it's down to the user to decide.

    It is possible however to turn off the qualification experience, allowing the system to decide what records to create if Existing Contact or Existing Account fields are populated. This is potentially more robust but i appreciate it may not suit your business needs.

    It's also possible to achieve this programmatically with JScript on change of the Status Reason. When the status reason equals qualified you could check if the Existing Contact or Existing Account fields are populated or not and create the records accordingly then update set the value of those fields with the new records.

    Hope this helps.

    Thanks
    Jason

    ------------------------------
    Jason McAndrew
    D365 Admin / Dev
    Sheffield, UK
    ------------------------------



  • 3.  RE: Force Account/Contact Creation on Lead Qualification?

    SILVER CONTRIBUTOR
    Posted Dec 16, 2022 08:01 AM
    The idea is that you are either attaching the lead to an existing account / contact or creating a new one.   I think they are getting in trouble because they are not attaching to an existing so then there is no account/contact to use when creating the opportunity.

    ------------------------------
    Kevin Knorr
    IT Director
    MHG Services
    Fort Lauderdale FL
    ------------------------------



  • 4.  RE: Force Account/Contact Creation on Lead Qualification?

    SILVER CONTRIBUTOR
    Posted Dec 19, 2022 08:34 PM
    Yep, this is exactly what they are doing. I'd like some way to stop them from doing it. A way to force them to either link the existing Account or leave the Account option as Yes so one is created upon qualification.

    ------------------------------
    Autumn Hearne
    Associate
    Pinion Global (formerly KCoe Isom)
    ------------------------------



  • 5.  RE: Force Account/Contact Creation on Lead Qualification?

    TOP CONTRIBUTOR
    Posted Dec 20, 2022 02:35 AM

    Hi Autumn,

     

    Please play a bit with this kind of plugins and eventually add your logic inside

    It could help also drive the plugin using special flag that you can change manually in the user interface.

    bye

     

    Giovanni Manunta

    CRM Technical Manager

     




    This e-mail (including attachments) is confidential and may be privileged. Please delete if obtained in error and email confirmation to the sender. Thank you for your cooperation.






  • 6.  RE: Force Account/Contact Creation on Lead Qualification?

    SILVER CONTRIBUTOR
    Posted Dec 16, 2022 09:40 AM

    You could create a realtime workflow for the opportunity that prevents saving of the opportunity if the account field is empty.  We use a similar approach for similar reasons.

     

    Bill Suycott

    Director FIS Sales Tools

    4900 West Brown Deer Road, Brown Deer, WI  53223

    T: 414-357-3082

    C: 414-651-7886

    FIS | Empowering the Financial World 

     

    The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.





  • 7.  RE: Force Account/Contact Creation on Lead Qualification?

    SILVER CONTRIBUTOR
    Posted Dec 19, 2022 08:32 PM
    I think a real time workflow may be the best option for us. I wonder if a real time workflow can be used on the Lead record, to prevent the status from changing to Qualified if the Account isn't being created? Not sure if/how that would work, but the mention of real-time workflows has me thinking.

    Thanks, William, for that idea! I will test it out on the Opportunity and see how it goes.

    Thanks everyone for your thoughts and input! This was helpful to me.

    ------------------------------
    Autumn Hearne
    Associate
    Pinion Global (formerly KCoe Isom)
    ------------------------------



  • 8.  RE: Force Account/Contact Creation on Lead Qualification?

    TOP CONTRIBUTOR
    Posted Dec 19, 2022 12:44 AM
    Edited by Giovanni manunta Dec 19, 2022 01:54 AM
    we had a similar requirements in the past, the idea is to drive the creation of Opportunity/Account/Contact based on your customer requirement 

    our solution was a Plugin prequalify (if a parentaccount is prefill do not create an additional account,, if a contact is prefill get the contact parent account and do not create neither account and contact for example), get the user the chance to decide if you want to create an opportunity or not 

    the code is not well formatted (I am sorry for that :(:(:(:( ) 

    public class LeadPreQualifyDriveopportunityContactAccountCreation : IPlugin
    {

    public void Execute(IServiceProvider serviceProvider)
    {
    IOrganizationService _organizationService; ITracingService _tracingService;
    _tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
    _tracingService.Trace("Plugin 'LeadPreQualifyDriveopportunityContactAccountCreation' has been called. ");


    //if (serviceProvider is null) throw new ArgumentNullException(nameof(serviceProvider));
    // Obtain the execution context from the service provider.
    IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
    // Extract the tracing service for use in debugging sandboxed plug-ins.

    // Obtain OrganizationServiceFactory and OrganizatíonSerive from serviceProvider
    var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
    _organizationService = factory.CreateOrganizationService(context.UserId);

    _tracingService.Trace($"IP{context.InputParameters.Count}");
    _tracingService.Trace($"IPcontains{context.InputParameters.Contains("LeadId")}");
    EntityReference leadReference = (EntityReference)context.InputParameters["LeadId"];

    _tracingService.Trace($"ldid{leadReference.Id}");
    var LeadEntity = _organizationService.Retrieve("lead", leadReference.Id, new ColumnSet("xyz_createopportunityoption", "parentcontactid", "parentaccountid"));
    //xyz_createopportunityoption --> 765740001 No 765740000 Yes
    OptionSetValue xyz_createopportunityoption = LeadEntity.GetAttributeValue<OptionSetValue>("xyz_createopportunityoption") != null ? LeadEntity.GetAttributeValue<OptionSetValue>("xyz_createopportunityoption") : null;
    _tracingService.Trace($"opp {xyz_createopportunityoption.Value}");

    EntityReference parentcontactid = LeadEntity.GetAttributeValue<EntityReference>("parentcontactid") != null ? LeadEntity.GetAttributeValue<EntityReference>("parentcontactid") : null;
    _tracingService.Trace($"Pc not null {parentcontactid != null}");


    EntityReference parentaccountid = LeadEntity.GetAttributeValue<EntityReference>("parentaccountid") != null ? LeadEntity.GetAttributeValue<EntityReference>("parentaccountid") : null;
    _tracingService.Trace($"PA not null {parentaccountid != null}");
    bool createOpp = false;
    if (xyz_createopportunityoption!= null)
    {
    createOpp = xyz_createopportunityoption.Value == 765740001 ? false : true;
    if(context.InputParameters.Contains("CreateOpportunity"))
    {
    context.InputParameters["CreateOpportunity"] = createOpp;
    }
    else
    {
    context.InputParameters.Add("CreateOpportunity", createOpp);
    }
    }

    bool createCon = parentcontactid == null;
    if (context.InputParameters.Contains("CreateContact"))
    {
    context.InputParameters["CreateContact"] = createCon;
    }
    else
    {
    context.InputParameters.Add("CreateContact", createCon);
    }

    bool createAcc = parentaccountid == null;
    if (context.InputParameters.Contains("CreateAccount"))
    {
    context.InputParameters["CreateAccount"] = createAcc;
    }
    else
    {
    context.InputParameters.Add("CreateAccount", createAcc);
    }
    context.InputParameters.Add("SuppressDuplicateDetection ", false);
    _tracingService.Trace($"CO {createOpp} CC {createCon} CA {createAcc}");
    }

    }

    ------------------------------
    Giovanni manunta
    Application Owner MS Dynamics 365 CE
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role