+ Start a Discussion

SObject row was retrieved via SOQL without querying the requested field... with Standard Controller

I have an inline VF page that contains a component. I pass the record object to the component so I can display fields from the record in the component. I am trying to add new fields to my component that reference data on the related object but when I do this I get the error: SObject row was retrieved via SOQL without querying the requested field: Configuration__c.Quantity__c. There is no Apex code here.

Component - configDetails:
<apex:component >
<apex:attribute name="config" description="This is the value for the Configuration" type="Configuration__c" required="true"/>


Inline VF page:
<apex:page showheader="false" standardController="Configuration__c">
<c:configDetails config="{!Configuration__c}"/>


This has been working fine for well over a year and the component currently displays data from the parent with no issues but when I try to add a new field I get this error.

Any idea what I am missing? I am only able to replicate this issue in production so I'm thinking it is some sort of security permission but I can't figure it out.



Message Edited by TehNrd on 12-16-2009 10:14 AM

Hello Teh;

  Sometimes you may need to add following code piece to your page and set the rendered property to false.

<apex:outputText value="{!config.Quantity__c}" rendered="false"/>


Please  follow this URL:





Support case # 03169217.


I was able to reproduce this in a recently refreshed sandbox.

Message Edited by TehNrd on 12-16-2009 10:19 AM

Hmm.. I've been getting this too. For now I've included the (hidden) field in my pages e.g.


<apex:inputhidden value="{!myObject__c.field__c}" />


Keen to find out what's happening, thanks for logging it.



Support also gave me the work around you mentioned but they may have read this post. I still think this is a bug as I will add the outputText field and it wont work but if I leave it on there for about a day it will start to work.

If I add the hidden input it will start to work immediately. I can them remove this hidden input and then it will still work.
Message Edited by TehNrd on 12-17-2009 09:57 AM
Is this still reproducible?

Doing a simple test this was not reproducible on Spring 10.


It is still reproducible on Winter 10.


Thanks Jason.



Know this is an old thread but though I would post for the record:


Thought I was having the same issue on Spring 10 but ended up being a Field Level Security issue.


Like Broz88, I got this error due to an FLS conflict. Be sure to check!


I just duplicated this error. Sounds like it should resolve within 24 hours but annoying nonetheless

I have just hit this issue! I chcked FLS and everything seems fine. Actually I have the same field displayed in the standard layout. This works fine in the dev org, but hitting this issue on a deployed org (managed pkg). I don't have the namespace prefix. Any suggestions what to try next?