Solving Error: SObject row was retrieved via SOQL without querying the requested field:

Got this tricky bug with my simple setup. I have a Visualforce page displaying one custom field(Percent) form to set a new value. I’m using a StandardController on the Quote object with an extension for other custom logic. Once value is passed a new visualforce page displays the new data.

It works fine like validation if value is non numeric or below 0 or higher then 100, but further testing such as adding two blanks spaces then an integer like 1 causes the error.

It would throw the SObject Exception error:

SObject row was retrieved via SOQL without querying the requested field: Quote.Name

Turns out to be a common problem as reference to

http://blog.jeffdouglas.com/2010/12/28/neat-salesforce-urlfor-trick/ and

http://forums.sforce.com/t5/Visualforce-Development/error-referencing-field-using-standard-controller-extension/m-p/83237

As for the fix simply adding the error field being reference, in my case the I added {!quote.name} in my Visualforce page solved the problem.

One thought on “Solving Error: SObject row was retrieved via SOQL without querying the requested field:

  1. Amazin’ Amazon AWS now merges with Cloud Support’s assurance. No need to worry or spend a dime for your Cloud computing support paraphernalia. No consultant, no consultancy fee. Just plug-n-play with our around the day and around the year- customer support services, and enjoy Cloud wonders freely.

Leave a Reply

Your email address will not be published. Required fields are marked *