You need to sign in to do that
Don't have an account?
Maf_007
Calling Visualforce page with standard controller from custom button
Hi All,
I have a visualforce page which overrides the new button for creating new record. It performs data validation and rerenders the page if something is wrong. I am trying to use same controller extension from a custom button as well. but when I add the visual force page in my button I get following error:
SObject row was retrieved via SOQL without querying the requested field:
A lot of people suggested to set rendered = false on the page but that does not meet my requirement as I need to get those fields in edit mode to perform similar action as I did when creating the record.
Any suggestions would be greatly appreciated.
I have a visualforce page which overrides the new button for creating new record. It performs data validation and rerenders the page if something is wrong. I am trying to use same controller extension from a custom button as well. but when I add the visual force page in my button I get following error:
SObject row was retrieved via SOQL without querying the requested field:
A lot of people suggested to set rendered = false on the page but that does not meet my requirement as I need to get those fields in edit mode to perform similar action as I did when creating the record.
Any suggestions would be greatly appreciated.
So to get around this you can either do another query for the field in the controller , or better yet you can simply include a hidden reference to it on the VF page somewhere, something like:
Code:
<apex:outputText value="{!Condition__c.Criterion__c}" rendered="false"/>
The standard controller will pick it up when constructing your query and you will be free to reference it in your extension.
Regards
Pramod
All Answers
So to get around this you can either do another query for the field in the controller , or better yet you can simply include a hidden reference to it on the VF page somewhere, something like:
Code:
<apex:outputText value="{!Condition__c.Criterion__c}" rendered="false"/>
The standard controller will pick it up when constructing your query and you will be free to reference it in your extension.
Regards
Pramod
My pleasure. Have a nice day !
Regards
Pramod