function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Lead to Opportunity Manual Conversion..

After doing some research.. i was rying to convert a Lead to an opportunity using the following code..but keep getting the error mentioned below..can anybody suggest where iam going Wrong...


trigger ConvertLead on Lead ( after update) {
for (Lead lead : {
if (lead.isConverted == false && lead.Approved__c=='YES' )

Database.LeadConvert lc = new Database.LeadConvert();

String oppName = lead.Name;

LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];

Database.LeadConvertResult lcr = Database.convertLead(lc);




Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger ConvertLead caused an unexpected exception, contact your administrator: ConvertLead: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: INVALID_STATUS, invalid convertedStatus: Qualified: []: Trigger.ConvertLead: line 15, column 1


Appreciate all the help,






Please check if the 'Converted' option is checked for the value 'Qualified' in the picklist 'Lead Status'.


Setup|Customize|Leads|Field|Lead Status|check for converted checkbox checked for 'Qualified'


Hi Vinita,


I did checked the converted Option and its checked.


Thanks for looking into this and please let me know if you have more insight tothis..