You need to sign in to do that
Don't have an account?
Aaron Persich 15
Inbound Change set Code Coverage failure
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.
Any help is much appreciated.
Thanks,
Aaron
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
Can you please share your test class code?
Many Thanks!
The test class needs to have atleat 75% code coverage. Can you share the test class.
Thanks