Documentation says it should be public, but getting an error:
Method does not exist or incorrect signature: void setOpportunityId(Id) from the type Database.LeadConvert
Any ideas why this method wouldn't be available?
Sample example:
Opportunity newOpp = new Opportunity();
insert newOpp;
Database.LeadConvert leadConvertCls = new Database.LeadConvert();
//This works fine
leadConvertCls.setLeadId(myLead.Id);
//Error when saving to org:
//Method does not exist or incorrect signature: void setOpportunityId(Id) from the type Database.LeadConvert (186:28)
leadConvertCls.setOpportunityId(newOpp.Id);
Database.LeadConvertResult conversionResult = Database.convertLead(leadConvertCls);
id
parameter is null, you will get this error.