You need to sign in to do that
Don't have an account?
Debbie Chrysochou
Total Price( from order product object) into VF email template
I have created an email to merge the order product fields into it. A snippet of my Code is :
I do get all the fields in order but do get an error for the Total price.
Error: Invalid field TotalPrice for SObject OrderItem
Any ideas?? ( the thing is that unit price and total price are under the object order item as I can understand. So its not a sum field that needs to sum up inside the email but pre-exists when you add the product and select the quantity and goes on the order products related list in Order)
<tr> <td style="background-color: #BA4697; color: #FFFFFF"> <b>Item/Package</b> </td> <td style="background-color: #BA4697; color: #FFFFFF"> <b>Amount</b> </td> <td style="background-color: #BA4697; color: #FFFFFF"> <b>Quantity</b> </td> <td style="background-color: #BA4697; color: #FFFFFF"> <b>Total</b> </td> </tr> <apex:repeat value="{!relatedTo.OrderItems}" var="lineItem"> <tr> <td> {!lineItem.PricebookEntry.Product2.Name} </td> <td> {!lineItem.UnitPrice} </td> <td> {!lineItem.Quantity__c} </td> <td> {!lineItem.TotalPrice} </td> </tr> </apex:repeat>
I do get all the fields in order but do get an error for the Total price.
Error: Invalid field TotalPrice for SObject OrderItem
Any ideas?? ( the thing is that unit price and total price are under the object order item as I can understand. So its not a sum field that needs to sum up inside the email but pre-exists when you add the product and select the quantity and goes on the order products related list in Order)
Total_Price__c = Quantity*Unit Price
All Answers
On my org I can't unit price and total price fields under Order object.
I suppose they are custom fields and if so, you have to change API name to UnitPrice__c and TotalPrice__c respectivly.
Hope this helps,
Fred
Total_Price__c = Quantity*Unit Price
You should mark this question as 'Solved'