• Tarek Schmidt
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi Guys,

i've just tried to add the discount field into a Order Visualforce.
But i get the following error Error: Invalid field Discount for SObject OpportunityLineItem

This is my Visualforce.

<table border="0" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Pos.</font></td>
    <!--   <td bgcolor="#C0C0C0"><font face="Arial">Produkt Nr.</font></td> -->
       <td bgcolor="#C0C0C0"><font face="Arial">Produkt</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Beschreibung</font></td>
              
       <td bgcolor="#C0C0C0"><font face="Arial">Anzahl</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Einzelpreis</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Discount</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Gesamt Preis</font></td>
</tr>
<tr>
<apex:variable value="{!1}" var="count"/>
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!FLOOR(count)} </td>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>
                          
             <td><apex:outputText value="{0, number, 0}">
              <apex:param value="{!line.Quantity}" /></apex:outputText></td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td>{!line.discount}</td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
          <apex:variable var="count" value="{!count+ 1}"/>
       </apex:repeat>  
</tr>
<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="7">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>

We have a professional edition so there is no field level security or something like this.
Any suggestions?
Thanks in advance.
Hi Guys,

i've just tried to add the discount field into a Order Visualforce.
But i get the following error Error: Invalid field Discount for SObject OpportunityLineItem

This is my Visualforce.

<table border="0" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Pos.</font></td>
    <!--   <td bgcolor="#C0C0C0"><font face="Arial">Produkt Nr.</font></td> -->
       <td bgcolor="#C0C0C0"><font face="Arial">Produkt</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Beschreibung</font></td>
              
       <td bgcolor="#C0C0C0"><font face="Arial">Anzahl</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Einzelpreis</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Discount</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Gesamt Preis</font></td>
</tr>
<tr>
<apex:variable value="{!1}" var="count"/>
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!FLOOR(count)} </td>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>
                          
             <td><apex:outputText value="{0, number, 0}">
              <apex:param value="{!line.Quantity}" /></apex:outputText></td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td>{!line.discount}</td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
          <apex:variable var="count" value="{!count+ 1}"/>
       </apex:repeat>  
</tr>
<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="7">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>

We have a professional edition so there is no field level security or something like this.
Any suggestions?
Thanks in advance.