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
gslatergslater 

Does Lead.Status change to reflect LeadConvert.setConvertedStatus ?

We're doing a custom Lead Convert through Apex code.  We use setConvertedStatus = 'Qualified' when we convert the Lead.  This works fine.  The thing is, when we query for the Converted Lead in execute anonymous with:

 

Lead l = [Select Status, isConverted from Lead where Id = :convertedId];

 

isConverted is true, but the Status does not change to Qualified, despite this being a valid option in the picklist.  Instead, it remains as "Open" which is a non-converted Status.

 

I thought Lead.Status changes to reflect LeadConvert.setConvertedStatus ?

JakobSJakobS
I fear 9 years later this post won't help you at all, but maybe someone else will encounter the same question.

I just implemented a custom Lead conversion and can observe the exact same behaviour you describe. My test kept failing due to the status not being updated.

The LeadConvert.setConvertedStatus(String status) method does not actually set the status of the converted lead. Whether this is intended or not is hard to tell as the documentation is not clear in that regard. In my opinion it is counterintuitive at least, if not incorrect behaviour. This is so strange because it is required to call the method and give it the desired converted status but seemingly without any effect.

Link to documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_convertLead.htm#apex_Database_LeadConvert_setConvertedStatus
subhadip dassubhadip das
According to this scheme, SC & ST can apply to the Sumangal (https://yojana.sarkaribook.in/odisha-intercaste-marriage-incentive-scheme-2021/) portal developed by Development. Incentives will be given within 60 days after the beneficiaries apply