+ Start a Discussion
Michael SchellMichael Schell 

Apex Class extension

I have a VF page that is not recognizing a field that i've created. I'm new to this keep in mind. I found an apex class extension and I believe this is whats driving what fields can be used on my VF page. I see some notes in here that our old developer used. I clicked on the show dependincies on my page and the field i'm trying to use is not on there. I feel like this below is telling my page what fields to use from my "Account" object. The new field i want to display i created on the account object. How do i add my new field to my VF page. Here is the part of the Apex Class below i believe thats pulling in the current fields used for the VF page. This below doesn't mean much to me. Please help. Thank you

 // Grab all fields for Account (Customer).
    Map<String, Schema.SObjectField> fieldsAccountMap = Schema.SObjectType.Account.fields.getMap();
    for( String key : fieldsAccountMap.keySet() ) {
      proposalFields += ',Order__r.Customer__r.' + key;
      proposalFields += ',Vendor__r.Account.' + key;
    }
shikher goelshikher goel

Hi, Well to add the field on the VF Page ,you don't need to use extensions until you need to do some extra logic. Let us take you have created Myfield__c on the account Object . then your VF looks like this belwo :

<apex:page standardController="Account">
  <apex:outputField value="{!account.MyField__c}" />

Above lines will work for you .if you just want to refer some fields on VF Page..

Please let me know if you need anything else.