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

convertLead() returns an error, but converts the lead anyway


"User A" creates a Lead; Lead owner is User A.
"User B" attempts to convert the Lead via the API.

User A is profile: system administrator, role: higher in the hierarchy
User B is profile: standard user, role: lower in the hierarchy


LeadConvertResult[0].success = false
LeadConvertResult[0].errors[0] = "insufficient access rights on cross-reference id"

...But the lead was actually converted!

Also, the LeadConvertResult does not return the newly created OpportunityId and ContactId, even though these records have been created.

Message Edited by HaroldH on 06-30-2005 06:29 PM

I solved my own problem.

The reason this error appeared is because I wasn't setting the ownerId property of the LeadConvert object. By default, this value is set to the owner of the Lead.

To prevent this error, specify the currently logged in user as the owner of the newly created Account, Contact, and Opportunity, by setting the ownerId property to the current userId.

Message Edited by HaroldH on 06-30-2005 06:32 PM