How To Access Profile.Name of Lead's Owner on Email Template - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
gege qiangege qian 

How To Access Profile.Name of Lead's Owner on Email Template

I'm using Email Template (Type HTML (using Letterhead)).

I can get lead's owner by uisng {!Lead.OwnerFullName} . But I also need to get the owner's profile. for example ReadOnly, SystemAdmin, Stanadrd User etc. I tried {!Lead.OwnerProfileName}  or
{!Lead.OwnerProfile.Name} or {!Lead.Owner.Profile.Name}. None of them worked. Is there a way that I can access directly instead of creating a formular field (like LeadOwnerProfile) on lead?

By the way, when I run soql I can use 
select id, name, ownerid, owner.name,owner.email, owner.profile.name from lead
and it worked.
Deepak AnandDeepak Anand
Unfortunately you can't get that straight within the Email Template. You'll have to create a Formula Field on the Lead object - 
  1. Label: Owner Profile Name
  2. Type: Formula
  3. Return Type: Text
  4. Formula
    Owner:User.Profile.Name
And then use that in the Email Template - 
{!Lead.Owner_Profile_Name__c}