You need to sign in to do that
Don't have an account?

VF Error Message on Quote SObject - Please Help!
I am working on a fairly basic Quote template using the new standard Quote object, and all is well until I get tot he <apex:repeat> section where I want to list all the Quote Line Items associated with the Quote.
I have this:
<apex:repeat var="line" value="{!Quote.QuoteLineItem}">
And I am getting this error message:
Error: Invalid field QuoteLineItem for SObject Quote
I am using the standard Quote controller. I also get a similar error when I try to use __r after QuoteLineItem.
Can someone please tell me what I am doing wrong here?
Thanks |
You need to use the name of the relationship, not the object. In this case, use "QuoteLineItems" rather than "QuoteLineItem". QuoteLineItems equates to a list. QuoteLineItem is just the name of an object.
Jeremy
All Answers
Hey,
I think you cant use Quote.QuotelineItem to get the child lineitems cos it takes it as object.field. Hence the error.
Try to use <apex:relatedlist> tag instead.
Thanks,
Sandeep
You need to use the name of the relationship, not the object. In this case, use "QuoteLineItems" rather than "QuoteLineItem". QuoteLineItems equates to a list. QuoteLineItem is just the name of an object.
Jeremy
Thank you both! Both things worked. I ended up going with Jeremy's suggestion, because the final product here is a printed document, so <apex:relatedList> didn't allow me to format the output in the way I needed too.
Thanks for the help! :smileyhappy: