You need to sign in to do that
Don't have an account?
Luvara
Sort order in Visualforce template
I'm merging in product line items into a visualforce template and I'd like the products to sort the same way they are in the Opportunity. Does anyone know how to do this? Here is my code..
Thanks, Chris
Thanks, Chris
Code:
<messaging:emailTemplate subject="Product Quote" recipientType="Contact" relatedToType="Opportunity"> <messaging:htmlEmailBody > <html> <body> <STYLE type="text/css"> Body {font-size: 11px; font-face: verdana } TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center } TD {font-size: 11px; font-face: verdana } TABLE {border: solid #CCCCCC; border-width: 1} TR {border: solid #CCCCCC; border-width: 1} </STYLE> <font face="arial" size="2"> <p>Dear {!recipient.name},</p> <table border="0" > <tr > <th>Product Name</th><th>Quantity</th><th>Total Price</th><th>Monthly Fee</th> </tr> <apex:repeat var="oli" value="{!relatedTo.OpportunityLineItems}"> <tr> <td>{!oli.PricebookEntry.Product2.Name}</td> <td>{!oli.Quantity}</td> <td>${!oli.TotalPrice}</td> <td>${!oli.Extended_Monthly_Fee__c}</td> </tr> </apex:repeat> </table> <p> <apex:repeat var="opp" value="{!relatedTo}"> <p> Total Subscription fees: ${!opp.X1St_Yr_ACV_Subscript__c}<br> Total Services fees: ${!opp.Professional_Services__c}<br> </p> </apex:repeat> <p> Please contact me with any questions, <apex:repeat var="o" value="{!relatedTo.Owner}"> <p> {!o.Name}<br> {!o.CompanyName}<br> {!o.Phone}<br> <a href="mailto:{!o.Email}">{!o.Email}</a><br> </p> </apex:repeat> <p /> </font> </body> </html> </messaging:htmlEmailBody> </messaging:emailTemplate>
You can use this component in your email template like this:
Message Edited by dchasman on 12-27-2008 12:14 PM
All Answers
You can use this component in your email template like this:
Message Edited by dchasman on 12-27-2008 12:14 PM
Hi,
Is there any easier way to implement a default sorting in apex:repeat without apex class?
Because it so complex if need to create apex class, create test method, create managed packaged in developer / sandbox and install it to enterprise edition JUST for a default sort.
sq
I'm using Simple Quote v1.0 and turns out, not so simple.
I am using visualforce to create a PDF of a quote from the Products in the Opportunity. But when I create the PDF, it doesn't sort the way that I have it in the opportunity. How can I fix this? I didn't completely understand the previous code for an email. Help please? Thanks!
Do we have any solution for this without creating controller, can we do something in the email template itself.
<apex:variable var="s_no" value="{!1}"/>
<apex:repeat var="quoteLineItem" value="{!relatedTo.Quote_Line_Items__r}">
<apex:repeat var="cx" value="{!relatedTo.Quote_Line_Items__r}">
<apex:outputPanel rendered="{!cx.num_Quotation_Number__c == s_no}" layout="none">
<tr><td>{!cx.num_Quotation_Number__c} </td>
<td>{!cx.pkl_Publisher__c}</td>
<td>{!cx.Name}</td>
.....
</tr>
</apex:outputPanel>
</apex:repeat>
<apex:variable var="s_no" value="{!s_no+1}"/>
</apex:repeat>