[SalesForce] SObject row was retrieved via SOQL without querying the requested field

I've been trying to understand the example at

http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_sample_standard.htm#pages

This is from VF Developer's Guide.

I have no luck. I tried to learn the code by understanding every line before typing it in (in other words, instead of copying and pasting). When I got all the code in and ran it, I got this error:

SObject row was retrieved via SOQL without querying the requested field: Account.BillingCity

So instead I created new files and simply copied and pasted the code in again, and got the same error. That means it's not my typo. Something is not working with the code properly. However, I couldn't figure out what the errors are.

I have already executed the reset() before calling the addFields() function on the controller. Is that not good enough?

Best Answer

I tried copying the code into two of my DE orgs. The code worked on a newer org on NA9, but my oldest org on NA12 didn't work. I suspect it has to do with the age of the org. I've seen other things not work in older DE orgs.

Related Topic