+ Start a Discussion
SandrineSandrine 

Find profile of lead owner, possible without query

Hello,

How can i get the profile of owner in an apex code.
Ideally from the old map of trigger.

I have Trigger.oldMap:
for(Lead l : Trigger.oldMap){
    l
}

Thank you for sugestion
Best Answer chosen by Sandrine
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Unfortunately, you can't do that. The trigger has all the direct fields of the object but not those available through relationships. trigger.new and trigger.old always give the current object field value.

You will have to query the database for the same. Please refer to the below link which might help you further.

https://developer.salesforce.com/forums/?id=906F0000000BVDqIAO

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas