You need to sign in to do that
Don't have an account?
Sowjanya Hegde 13
Fetch the Lead owner upon Lead conversion
I have created Lead and I have set the Lead owner as Queue. Then I converted Lead to Opportunity. Now If I check the Lead owner it shows logged in user(myself) as a Lead owner. How can I fecth the actual lead owner(QUEUE) after lead conversion ? Please help!
I was able to fetch the ownerId after the conversion of the Lead with the following code:
if (Trigger.isBefore) {
if (Trigger.isUpdate) {
for (Lead ld : Trigger.new) {
Lead leadDetail = trigger.oldmap.get(ld.Id);
Id ownerIdBeforeConvert = leadDetail.OwnerId;
}
}
}
All Answers
Greetings!
The Lead owner will be changed to the user who converted the Lead after converion as per the below article.
https://help.salesforce.com/articleView?id=000328720&type=1&mode=1
Please mark it as best answer if it helps you to fix the issue.
Thank you!
Regards,
Shirisha Pathuri
I was able to fetch the ownerId after the conversion of the Lead with the following code:
if (Trigger.isBefore) {
if (Trigger.isUpdate) {
for (Lead ld : Trigger.new) {
Lead leadDetail = trigger.oldmap.get(ld.Id);
Id ownerIdBeforeConvert = leadDetail.OwnerId;
}
}
}