You need to sign in to do that
Don't have an account?
Mrutyunjay
Test class issue in lead convert
Hi
I have some code like this ,this works fine generally
Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(leadid); lc.setConvertedStatus(selectstatus);
lc.setDoNotCreateOpportunity(true);
lc.setOverwriteLeadSource(false);
lc.setSendNotificationEmail(false);
Database.LeadConvertResult lcr = Database.convertLead(lc);
system.debug('leadconvert'+lcr.isSuccess());
But when i write test class for this, leadconvert result always returns false.
Any way to cover this lines of code or any way to fix it out.
Hi Mrutyunjay,
add this line to the end of the code:
system.debug('errors=' + lcr.getErrors());
And tell me what you got.