• Jerry Blackwood
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello,

I am trying to push an Apex Class which auto converts a lead into a contact.  When I try to deploy this in production I get the following error.  I am not too familiar with Apex Classes and not sure how to resolve this.

Your code coverage is 38%. You need at least 75% coverage to complete this deployment.
 
Public class AutoConvertLeads
{
    @InvocableMethod
    public static void LeadAssign(List<Id> LeadIds)
    {
            Database.LeadConvert Leadconvert = new Database.LeadConvert();
            Leadconvert.setLeadId(LeadIds[0]);
            LeadStatus Leads= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
            Leadconvert.setConvertedStatus(Leads.MasterLabel);
            Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to   create an opportunity from Lead Conversion 
            Database.LeadConvertResult Leadconverts = Database.convertLead(Leadconvert);
            System.assert(Leadconverts.isSuccess());
   }
}


Any help is much appreciated.

Thanks,

Aaron
 
Is it possible to create an email template with LWC? Currently, I am using a VF or pure HTML to create such templates.
Hi - I am not a developer, but have created a simple visualforce page for a post-chat survey.  
The problem is that when clicking on the link in the page - they are directed to a site that is not error message