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
Jane Brady 12Jane Brady 12 

Error: Formula expression is required for attribute value in <apex:repeat> in Order_Downpayment_Received at line 18 column 61

Having a problem with my first Visualforce email template. I'm trying to show order products on the email, and I can't find the answer on my own to fix the error in question title. All help is greatly appreciated!

My code is:

<messaging:emailTemplate subject="Downpayment Received from {!relatedTo.Account.Name} for Order {!relatedTo.OrderNumber}" recipientType="User" relatedToType="Order">

<messaging:htmlEmailBody >   
<html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 13px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 13px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="2">               
<p>Hello!</p>
<p>We received the downpayment from {!relatedTo.Account.Name} for Order {!relatedTo.OrderNumber} on {!relatedTo.Payment_Received_1__c}.</p>
<p>Products on this order are:</p>
<apex:repeat var="lineItem" Value="{relatedTo.OrderItems}" >
<p>({lineItem.Quantity})- {lineItem.PricebookEntry} - {lilneItem.OrderProduct.Description__c} [{lineItem.OrderProduct.Screen_Opening__c}</apex:repeat> </p>
<p>The currently scheduled ship date for this order is {!relatedTo.Assigned_Ship_Date__c}. The salesman for this order is {!relatedTo.Salesman__c}.</p>
<p>Thank you!</p>
</font>
   </body>
  </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
 
Best Answer chosen by Jane Brady 12
sumit singh 37sumit singh 37

you need to add an ! mark in all values

{!lineItem.Quantity}, {!lineItem.PricebookEntry}

All Answers

sumit singh 37sumit singh 37

in Apex repeat 

<apex:repeat var="lineItem" Value="{!relatedTo.OrderItems}" >

sumit singh 37sumit singh 37

you need to add an ! mark in all values

{!lineItem.Quantity}, {!lineItem.PricebookEntry}

This was selected as the best answer
Jane Brady 12Jane Brady 12
Thank you so much! That solved that particular problem. This is my first exercise with Visualforce and I'm finding it tough going!
sumit singh 37sumit singh 37
please mark as best ans if heplful and give a like