You need to sign in to do that
Don't have an account?
Kayla Even 8
Add Approval Comments to Approval Request Visualforce template
I currently have the below visualforce template for our Approval Request template. I would like to add the Approval Comments to the email from any approval completed for the same quote, before it gets to me.
For example, if I am approver 3, and approver 1 & 2 left a comment in their approval, I would want that to show in the email I receive. Does anyone know how to do this? I asked support and they said to use sbaa__CommentsLong__c merge field, but would need to iterate through related records and that's where I am lost.
<messaging:emailTemplate subject="APPROVED: {!relatedTo.Quote__r.Name}, {!relatedTo.Quote__r.SBQQ__Opportunity2__r.Owner.Name}" relatedToType="sbaa__Approval__c">
<messaging:HtmlEmailBody >
<html>
<body>
{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Owner.Name} has requested that you approve the following:
<p>
<span>
<b>Account: </b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.SBQQ__Account__r.ID}">{!relatedTo.Quote__r.SBQQ__Account__r.Name}</a>
</span> <br/>
<b>
Customer ARR:</b> $<apex:outputText value="{0, number, ###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Account__r.ARR__c}" /></apex:outputText>
<br/>
<b>Opportunity:</b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.SBQQ__Opportunity2__r.ID}">{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Name}</a>
<br/>
<b>Net ARR:</b> $<apex:outputText value="{0, number, ###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Net_ARR2__c}" /></apex:outputText>
<br/>
<b>Type of Sale:</b> {!relatedTo.Quote__r.SBQQ__Opportunity2__r.Type_of_Sale__c}
<br/>
<b>Opportunity Close Date:</b> {!month(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}/{!day(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}/{!year(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}
<br/><br/>
<b>Quote:</b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.ID}">{!relatedTo.Quote__r.Name}</a>
<br/>
<b>Total:</b> $<apex:outputText value="{0, number,###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Total_Services__c}" /></apex:outputText>
<br/>
<b>Start Date:</b> {!month(relatedTo.Quote__r.SBQQ__StartDate__c)}/{!day(relatedTo.Quote__r.SBQQ__StartDate__c)}/{!year(relatedTo.Quote__r.SBQQ__StartDate__c)}
<br/>
<b>First Segment Term End Date:</b> {!month(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}/{!day(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}/{!year(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}
<br/>
<b>End Date:</b> {!month(relatedTo.Quote__r.SBQQ__EndDate__c)}/{!day(relatedTo.Quote__r.SBQQ__EndDate__c)}/{!year(relatedTo.Quote__r.SBQQ__EndDate__c)}
<br/>
<b>Term:</b> {!relatedTo.Quote__r.SBQQ__SubscriptionTerm__c}
<br/>
<b>Master Contract:</b> {!relatedTo.Quote__r.SBQQ__MasterContract__c}
<br/>
</p>
</body>
</html>
For example, if I am approver 3, and approver 1 & 2 left a comment in their approval, I would want that to show in the email I receive. Does anyone know how to do this? I asked support and they said to use sbaa__CommentsLong__c merge field, but would need to iterate through related records and that's where I am lost.
<messaging:emailTemplate subject="APPROVED: {!relatedTo.Quote__r.Name}, {!relatedTo.Quote__r.SBQQ__Opportunity2__r.Owner.Name}" relatedToType="sbaa__Approval__c">
<messaging:HtmlEmailBody >
<html>
<body>
{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Owner.Name} has requested that you approve the following:
<p>
<span>
<b>Account: </b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.SBQQ__Account__r.ID}">{!relatedTo.Quote__r.SBQQ__Account__r.Name}</a>
</span> <br/>
<b>
Customer ARR:</b> $<apex:outputText value="{0, number, ###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Account__r.ARR__c}" /></apex:outputText>
<br/>
<b>Opportunity:</b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.SBQQ__Opportunity2__r.ID}">{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Name}</a>
<br/>
<b>Net ARR:</b> $<apex:outputText value="{0, number, ###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Net_ARR2__c}" /></apex:outputText>
<br/>
<b>Type of Sale:</b> {!relatedTo.Quote__r.SBQQ__Opportunity2__r.Type_of_Sale__c}
<br/>
<b>Opportunity Close Date:</b> {!month(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}/{!day(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}/{!year(relatedTo.Quote__r.SBQQ__Opportunity2__r.CloseDate)}
<br/><br/>
<b>Quote:</b> <a href="https://cartegraph--sandbox.lightning.force.com//{!RelatedTo.Quote__r.ID}">{!relatedTo.Quote__r.Name}</a>
<br/>
<b>Total:</b> $<apex:outputText value="{0, number,###,###,###.##}"><apex:param value="{!relatedTo.Quote__r.SBQQ__Opportunity2__r.Total_Services__c}" /></apex:outputText>
<br/>
<b>Start Date:</b> {!month(relatedTo.Quote__r.SBQQ__StartDate__c)}/{!day(relatedTo.Quote__r.SBQQ__StartDate__c)}/{!year(relatedTo.Quote__r.SBQQ__StartDate__c)}
<br/>
<b>First Segment Term End Date:</b> {!month(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}/{!day(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}/{!year(relatedTo.Quote__r.SBQQ__FirstSegmentTermEndDate__c)}
<br/>
<b>End Date:</b> {!month(relatedTo.Quote__r.SBQQ__EndDate__c)}/{!day(relatedTo.Quote__r.SBQQ__EndDate__c)}/{!year(relatedTo.Quote__r.SBQQ__EndDate__c)}
<br/>
<b>Term:</b> {!relatedTo.Quote__r.SBQQ__SubscriptionTerm__c}
<br/>
<b>Master Contract:</b> {!relatedTo.Quote__r.SBQQ__MasterContract__c}
<br/>
</p>
</body>
</html>
Emily Hann
Did you ever figure this out? I am interested in doing the same
Kayla Even 8
No, we didn't end up adding it to the email but we did add it the comments column to the approvals related list so that everyone can see the comment that may have been left with the previous approval.