You need to sign in to do that
Don't have an account?
Tarek Schmidt
Error: Invalid field Discount for SObject OpportunityLineItem
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.
We have a professional edition so there is no field level security or something like this.
Any suggestions?
Thanks in advance.
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> <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.
Discount__c is formula field
there you should write flormula like this
product2__r.discount
note : i am not sure Discount is belong to which object...u can find and replace the product2 if some other object means
in vf page you should try like this
line.Discount__c
All Answers
<td>{!line.discount__c}</td>
Discount field in OpportunityLineItem is not by default accessible. Before using this field in VF page you need to set the Field Accessibility & field level security. For setting the field accessibility :
Setup -> Customize -> Opportunities -> Opportunity Product -> field -> Discount
Once you set the visibilty of this field, save ur page.
Discount__c is formula field
there you should write flormula like this
product2__r.discount
note : i am not sure Discount is belong to which object...u can find and replace the product2 if some other object means
in vf page you should try like this
line.Discount__c