Posts

Showing posts with the label conversion

Salesforce Fact #903 | Check Lead coversion access in LWC

Image
How to check if the current user has access to convert lead or view and edit converted leads in LWC. User permission checks to the rescue. We can use the two user permissions: ConvertLeads and AllowViewEditConvertedLeads to check the same. Reference:  https://www.sfdcamplified.com/challenge-map-between-salesforce-permissionname-and-label/ Attached is the screenshot.

Salesforce Fact #902 | Setting record owner during lead conversion

If a Lead is owned by a Queue, then during lead conversion we need to set the ownerId to any user who will be the owner of the converted account and contact record. So while converting lead from apex code we need to set the owner id else the below error is encountered: System.DmlException: ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Converted objects can only be owned by users. If the lead is not owned by a user, you must specify a user for the Owner field.: [OwnerId]