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
VK86VK86 

Mail Merge Opportunity Line Items

Hello All,

 

I have a workflow(on Opportunity) which sends out an email with Opportunity details.  

In the email template, I want to merge the 'Opportunity Line Item' but didn't find them.

 

Is there a way I can get the Opportunity Line items onto the email template? 

 

Any suggestions please?

 

Thank you,

VK86 

beener3beener3

Hi VK86,

Were you able to resolve this? I am in a similar situation, I would like to create a mass mail merge where each document has master & detail rows.

 

Any ideas?

 

Thanks.

 

Ben 

VK86VK86

Hello Beener3,

 

I was able to resolve this using VF email template.

Below is an example Code I used to merge Opportunity Line Items:

 

<apex:repeat value="{!relatedTo.OpportunityLineItems}" var="line">

          <tr >

             <td>{!line.PricebookEntry.Name}</td>

             <td>{!line.Description}</td>   

             <td>{!line.PricebookEntry.Product2.ProductCode}</td>   

             <td>{!line.Quantity}</td>

          </tr>

       </apex:repeat>   

 

The catch here is using the 'apex:repeat' function using which all the 'detail' rows for a master can be merged on email.

Hope this is helpful.

 

Thanks,

VK86