3 Antworten
Starting API v36.0 you should no longer use MasterLabel, your code could fail - use ApiName instead:
LeadStatus CLeadStatus = [SELECT Id, ApiName FROM LeadStatus WHERE isConverted=true Limit 1];
...
Leadconvert.setConvertedStatus(CLeadStatus.ApiName);
...