• Curt Griffin 27
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I want to display the Discount column in a Table generated via a VF Email Template when the Opportunity's Discounted__c field is True.

When Discounted__c = False, the Discount colunm is not displayed. 

I'm OK with duplicating the Table Code for the two conditions Discounted__c True/False.

Here is the VF Code that creates the Table:

Table Code
<thead>
<table class="six">
  <tr>
    <th class='LeftBorder1' bgcolor="#364E88">Product Code</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Product</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Description</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Qty</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">List Price</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Discount</th> 
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Sales Price</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Total Price</th>
</tr>
</thead>

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

  <tr style= "page-break-inside: avoid; page-break-after: auto;border-top: 1px solid #666;">
  <td class='LeftBorder'>{!line.PricebookEntry.ProductCode}</td>
  <td class='RightBorder'>{!line.PricebookEntry.Name}</td>
  <td class='RightBorder'><apex:OutputField value="{!line.Product_Description__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Quantity__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Unit_Price__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Discount__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Sales_Price__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Total_Price__c}"/></td>

  </apex:repeat>
I want to display the Discount column in a Table generated via a VF Email Template when the Opportunity's Discounted__c field is True.

When Discounted__c = False, the Discount colunm is not displayed. 

I'm OK with duplicating the Table Code for the two conditions Discounted__c True/False.

Here is the VF Code that creates the Table:

Table Code
<thead>
<table class="six">
  <tr>
    <th class='LeftBorder1' bgcolor="#364E88">Product Code</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Product</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Description</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Qty</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">List Price</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Discount</th> 
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Sales Price</th>
    <th class='LeftBorder1' bgcolor="#364E88" style="font-size 80%">Total Price</th>
</tr>
</thead>

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

  <tr style= "page-break-inside: avoid; page-break-after: auto;border-top: 1px solid #666;">
  <td class='LeftBorder'>{!line.PricebookEntry.ProductCode}</td>
  <td class='RightBorder'>{!line.PricebookEntry.Name}</td>
  <td class='RightBorder'><apex:OutputField value="{!line.Product_Description__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Quantity__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Unit_Price__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Discount__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Sales_Price__c}"/></td>
  <td class='RightBorder'><apex:OutputField value="{!line.CPQ_Total_Price__c}"/></td>

  </apex:repeat>