function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dfcdfc 

Page in a Page SObject Field Access

I have a custom object:  AccountSetup__c.  On the default page layout for this object I have a section that contains a VisualForce page that starts with:

 

<apex:page title="Account Setup Process Management"
           standardController="AccountSetup__c" extensions="AccountSetupControllerExtension"
           sidebar="false" showHeader="false">
etc.....

 

Here's the question:  What SObject fields are freely accessible to the extension controller via StandardController.getRecord()?  The fields on the outer page layout?  The fields on the inner VisualForce page?  A union of these fields?  It is not clear what the answer is and my results are quirky.  The constructor of my extension controller:

 

    public AccountSetupControllerExtension(ApexPages.StandardController stdController) {
        m_as = (AccountSetup__c)stdController.getRecord();

etc.....

 

In other words, what fields are pre-populated in m_as?

 

Thanks!


Dave

 

SargeSarge

Hi,

 

  From my experience, I was able to get the fields which are referred in <apex:inputField/> <apex:outputField> and <apex:inputHidden/> components in the inline VF page. Try using <apex:inputHidden/> component as a head start.

 

Cheers..

AdyAdy

getRecord is used to get the values of the record from the page. All the fields that are used to display on the page can be accessed using your variable. If none of the fields are used in the page to display then only id will be available in 'm_as'.

dfcdfc

Thanks, Sarge.

 

So, to clarify, your experience is that the inline VF page fields are accessible to the inline VF page controller, but the outer page layout fields are not?

 

Thanks.


Dave

 

AdyAdy

I mean, all the fields that are used in the pagelayout that are displayed in the VF page hold the values, others do not. Example: If the page has only Name in the VF page, then using m_as, you can access only this field value and Id but not other fields values

SargeSarge

 

 

   Ady, that is the point I am trying to tell.  All the fields that are referenced by the "SObject Conscious" tags are available in m_as. I am not sure about the Id, but just give a try.

 

And to clarify, yes the controller variable m_as is having the field referenced in inline VF page and not the fields from standard page itself.

 

Cheers..

AdyAdy

lol...

 

Yes, id will also be available..