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
Ad.baylesAd.bayles 

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 :

{!ApprovalRequest.Internal_URL}

{!ApprovalRequest.External_URL}

..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}"
recipientType="User"
relatedToType="MyCustomObject__c">

 

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 ?

Ad.baylesAd.bayles

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

 

https://cs7.salesforce.com/p/process/ProcessInstanceWorkitemWizardStageManager?id=04iM00000008ghz

 

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.

 

-Andy

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