You need to sign in to do that
Don't have an account?
Krista Kelly
Capture Comments in Submit for Approval button in an email
Hello, it's been requested that when our users hit the "Submit for Approval" button the Visualforce email that is sent to approver's also captures the Comments in the pop-up window that is written in the Process Instance step. Has anyone successfully done this? I found this code Capture Comments in Component
Capture Comments (https://gist.github.com/douglascayers/46bb1e92be9909d60fee) and although it seems it should work the Comments are coming through as blank. The sql in the class does grab the comment I need. Even if I hard-code the Quote number in the Visualforce template when I save it previews the comments I need. Any advice would be appreciated!
This is my Visualforce email
Capture Comments (https://gist.github.com/douglascayers/46bb1e92be9909d60fee) and although it seems it should work the Comments are coming through as blank. The sql in the class does grab the comment I need. Even if I hard-code the Quote number in the Visualforce template when I save it previews the comments I need. Any advice would be appreciated!
This is my Visualforce email
<messaging:emailTemplate subject="Quote Number: {!relatedTo.Name} Approval Request from: {!relatedTo.Opportunity_Owner__c} for {!relatedTo.Opportunity_Name_Without_Stage__c} totaling {!relatedTo.Formatted_Net_Amount__c}" recipientType="User" relatedToType="SBQQ__Quote__c" > <messaging:htmlEmailBody > <html> <head> <style type="text/css"> .emph { font-weight: bold; } </style> </head> <body> <br/> <div style="width: 90%;margin: 0 auto;"> <!-- <p>Payment terms: <span style="font-weight: bold;">{!relatedTo.SBQQ__PaymentTerms__c}</span></p> <p>Shipping terms: <span style="font-weight: bold;">{!relatedTo.Shipping_Terms__c}</span></p> <p>Quote expiry date: <span style="font-weight: bold;">{!relatedTo.SBQQ__ExpirationDate__c}</span></p> <p>Quote description: <span style="font-weight: bold;">{!relatedTo.Description__c}</span></p> <p>Quote comments: <span style="font-weight: bold;">{!relatedTo.SBQQ__Notes__c}</span></p> <p>Freight (if applicable): <span style="font-weight: bold;">{!relatedTo.Shipping_and_Handling__c}</span></p> <p>Tax (if applicable): <span style="font-weight: bold;">{!relatedTo.Tax__c}</span></p> --> <apex:OutputLabel value="Account Name: " /><apex:outputText style="font-weight: bold;" value="{!relatedTo.SBQQ__Account__r.Name}"/><br/> <apex:OutputLabel value="Payment terms: " /><apex:outputText style="font-weight: bold;" value="{!relatedTo.SBQQ__PaymentTerms__c}"/><br/> <apex:OutputLabel value="Shipping terms: " /><apex:outputText style="font-weight: bold;" value="{!relatedTo.Shipping_Terms__c}"/><br/> <apex:OutputLabel value="Quote expiry date: " /><span style="font-weight: bold;"><apex:outputField value="{!relatedTo.Expiration_Date_formula__c}"/></span><br/> <apex:OutputLabel value="Quote description: " /><apex:outputText style="font-weight: bold;" value="{!relatedTo.Description__c}"/><br/> Comments: <c:ApprovalRequestComments relatedToId="{!relatedTo.Id}"/><br/> <apex:OutputLabel value="Quote comments: " /><apex:outputText style="font-weight: bold;" value="{!relatedTo.Additional_Comments__c}" escape="false"/><br/> <apex:OutputLabel rendered="{!!ISBLANK(relatedTo.Shipping_and_Handling__c)}" value="Freight: "/><span style="font-weight: bold;"> <apex:outputtext rendered="{!!ISBLANK(relatedTo.Shipping_and_Handling__c)}" value="{!relatedTo.SBQQ__Opportunity2__r.CurrencyISOCode}" /> <apex:outputText rendered="{!!ISBLANK(relatedTo.Shipping_and_Handling__c)}" value="{0, number, ###,###,###.00}"> <apex:param value="{!relatedTo.Shipping_and_Handling__c}" /> </apex:outputText></span><br/> <apex:OutputLabel rendered="{!!ISBLANK(relatedTo.Tax__c)}" value="Tax: "/><span style="font-weight: bold;"> <apex:outputtext rendered="{!!ISBLANK(relatedTo.Tax__c)}" value="{!relatedTo.SBQQ__Opportunity2__r.CurrencyISOCode}" /> <apex:outputText rendered="{!!ISBLANK(relatedTo.Tax__c)}" value="{0, number, ###,###,###.00}"> <apex:param value="{!relatedTo.Tax__c}" /> </apex:outputText></span><br/> <c:CPQQuoteDetails quote="{!relatedTo}"/><br/> <apex:outputlink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}">Please click this link to approve or reject the record.</apex:outputlink> </div> </body> </html>
https://trailblazer.salesforce.com/ideaView?id=08730000000BqAj
Thanks,