+ Start a Discussion

Unable to reference owner fields from Opportunity Controller

Hi all,


I have a VF page on Opportunity in which I want to display owner information. If I use the standard Opportunity controller I can do this without a problem:




However, I have created a controller extension since I need to order the OppLineItems in a certain way and do a bit more stuff. Now the above line is failing which kind of makes sense because there is no "Owner" field on an opportunity, only an "OwnerId" field. Howeve if I try:




I get an "unknown property 'String.LastName'


Any ideas? Thanks,



Best Answer chosen by Admin (Salesforce Developers) 
Sorted, I had to reference Owner.LastName in the SELECT within the Controller (I was trying to reference "Owner" by itself).