There seems to be an issue with displaying Person Account recordtypes in a VF page (as a field or in a table) - it says the recordtype is invalid for 'Account'.
I'm listing the results of an account list which is a mix of standard Account records and Person Account records. The standard recordtypes display fine, but not the PersonAccount ones.
My controller code that gets the values:
public void displayAccounts(){
colHeaders = new string[]{'Name','RecordTypeId','PersonEmail'};
acclist = [select name, recordtypeid, personemail from account] ;
system.debug('####importTestDataFromCSVController acclist: ' + acclist);
}
And my VF page display:
<apex:pageBlock >
<apex:pageBlockTable id="importvalues" value="{!accList}" var="rec">
<apex:repeat value="{!colHeaders}" var="FieldLabel">
<apex:column value="{!rec[FieldLabel]}"/>
</apex:repeat>
</apex:pageBlockTable>
</apex:pageBlock>
This is what displays on the page:
Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Record Type ID: value not valid for the entity: Account".
If I exclude the PersonAccount records, it displays fine showing the name of the standard Account recordtype.
How do I get it to work with Person Accounts?