I'm trying to use Database.LeadConvert to set Account fields based on a condition, as such:
Database.LeadConvert lc= new Database.LeadConvert();
lc.setLeadId(lead.Id);
lc.setConvertedStatus('Closed-Converted');
lc.accountrecord.CustomField = 'Value';
Database.leadConvertResult lcr = Database.convertLead(lc);
However I get a "Variable does not exist: CustomField" Error in the second to last line.
How would I go about achieving the task using Database.LeadConvert class?
Huge thanks in advance