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

How to display Approval Request links in visualforce email template related to a custom object ?

How do you get the same URLs used in HTML templates, in VisualForce templates that are not directly linked to the Approval Process Object Type ?


When sending approval requests HTML format, you have the following merge fields :



..that allow you to send direct link to the approval page, additionally to any object-related merge fields.


In my VisualForce template, I use a Custom Object as 'relatedToType' Object, so as to display merge fields linked to this object and provide extra information to the assigned approver.

<messaging:emailTemplate subject="{relatedTo.Name"} pending request from {!relatedTo.Owner.Name}"


I would like to use these URLs in my Visualforce template, but cannot find how to set the URL with the appropriate ID parameters.

Any thoughts ?


In the VisualForce template, the internal link would look like :


I am just unable to get the appropriate id parameter

Andy BoettcherAndy Boettcher

Take a peek at the ProcessInstance object - that will have the Ids you need.



Anna Rudenko 9Anna Rudenko 9
@Ad.bayles did you find an answer? I am having the same issue.