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
scottrmscottrm 

merge fields in custom template for approvals

I wish to create a custom template for approvals, however I am having some trouble finding where in the documentation it specifies the name of the merge fields related to the approval such as those to generate the link, all I could find was this reference in the online help "If the email template you choose contains approval merge fields named {!ApprovalRequest.field_name},..." but it does not specify what the field names are for the approval request.

 

 

Know where I can find more information.

Best Answer chosen by Admin (Salesforce Developers) 
netTrekker_ADnetTrekker_AD

When I create an email template in HTML, it allows me to select Approval Fields as one of the available sets of fields to get merge fields from. Can you not see them? This is everything I have:

 

{!ApprovalRequest.External_URL}

{!ApprovalRequest.Internal_URL}

{!ApprovalRequest.Process_Name}

{!ApprovalRequest.Process_Step_Name}

{!Workitem.ID} (this is for Approval Request ID not what I put before)

{!ApprovalRequest.Comments}

{!ApprovalRequest.Status}

{!ApprovalRequest.Response_Date}

{!ApprovalRequest.Process_Assignee}

{!ApprovalRequest.Process_Assignee_Id}

{!ApprovalRequest.Process_Approver}

{!ApprovalRequest.Process_Approver_Id}

 

All Answers

netTrekker_ADnetTrekker_AD

Are you saying you want to create an email template with a link to whatever record needs approval?

 

http://XXX.salesforce.com/{!ApprovalRequest.ID} where XXX is your instance of Salesforce.

scottrmscottrm

Thanks, that is sort of what I want, I also wanted to know what the names fo the other fields on the ApprovalRequest object were

netTrekker_ADnetTrekker_AD

When I create an email template in HTML, it allows me to select Approval Fields as one of the available sets of fields to get merge fields from. Can you not see them? This is everything I have:

 

{!ApprovalRequest.External_URL}

{!ApprovalRequest.Internal_URL}

{!ApprovalRequest.Process_Name}

{!ApprovalRequest.Process_Step_Name}

{!Workitem.ID} (this is for Approval Request ID not what I put before)

{!ApprovalRequest.Comments}

{!ApprovalRequest.Status}

{!ApprovalRequest.Response_Date}

{!ApprovalRequest.Process_Assignee}

{!ApprovalRequest.Process_Assignee_Id}

{!ApprovalRequest.Process_Approver}

{!ApprovalRequest.Process_Approver_Id}

 

This was selected as the best answer
mworld2mworld2

I see these too in my email templates but then they don't give values in the email when I use them in my process. They are blank. What gives?

sfdcFanBoysfdcFanBoy

The merge fields {!ApprovalRequest.Process_Assignee}  and {!ApprovalRequest.Process_Approver} in the email templates (for approvals emails) do not work as expected. 

 

When I assign a record to a USER A,

{!ApprovalRequest.Process_Assignee}  and {!ApprovalRequest.Process_Approver}  both show MY NAME.

 

But Ideally, one of them should display USER A name.

 

Any ideas?

sivaextsivaext

Hi 

 

  you want display approval manager name , 

 

  Select field type : Sending user fields

  Select Field : manager 

 

  then copy the merge field. i.e {!user.Manager}

Kim HealyKim Healy
I had a ton of trouble with this, and found a workaround to it- use {!User.Name} instead of {!ApprovalRequest.Process_Approver}. In either the email or you can save it into a text field with a field update as the last step of the approval process. Because the user who approved it is the current user, you can get any data you need that way, if {!ApprovalRequest.Process_Approver} isnt working for you. I figured it out because the email subject had the right user, and the field doesnt give the right one, and the subject is based off the current user. 
Bhawani SharmaBhawani Sharma
This may probably help:
http://simplyforce.blogspot.in/2014/07/approval-fields-in-email-notification.html