+ Start a Discussion
SandrineSandrine 

Exception for "Object row was retrieved via SOQL "

Hello,

I am overriding a button.

 get below error message
"|EXCEPTION_THROWN|[EXTERNAL]|System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: CustomObject__c.Name"

I making no query

What can be the reason ?
Best Answer chosen by Sandrine
Deepak Pandey 13Deepak Pandey 13
put the name field on your soql. without query this field you can not use on your vf pages....

All Answers

Deepak Pandey 13Deepak Pandey 13
put the name field on your soql. without query this field you can not use on your vf pages....
This was selected as the best answer
Amit Chaudhary 8Amit Chaudhary 8
Please post your code. You need to add same field in your SOQL query.
SandrineSandrine
i added hidden field it solved issue