+ Start a Discussion

Find profile of lead owner, possible without query


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){

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

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.


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