My code below is giving me an error- System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.mfField__c
I'm not clear on why I'm getting this error...
Help?
<apex:page standardController="Account" extensions="myObjectController">
<apex:form >
<apex:pageBlock title="Archived Records">
<apex:pageBlockTable value="{!relatedRecords}" var="item">
<apex:column value="{!item.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller
public with sharing class myObjectController {
Account current;
List<Account> relatedRecords{get;set;}
public myObjectController(ApexPages.StandardController controller) {
this.current = (Account )controller.getRecord();
this.relatedRecords = [select id, name, mfField__c from Account where mfField__c = :this.current.mfField__c];
}
}