+ Start a Discussion
CutMyCostsCutMyCosts 

Cannot use Picklist with Person Account

Hello,

 

I am trying to create a custom page that allows people to enter information about Accounts. It was working fine until we added Person Accounts, now it fails with this error when you try to access the page:

 

 

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". 

 

 

It still works fine when entering the information of a Business Account, but fails when attempting to do so for a Person Account.

 

I have narrowed it down to a picklist field causing the error. Whenever an inputField that is bound to a picklist is added the error occurs.

 

Snipped code:

 

 

<apex:page id="NeedsPage" standardController="Account">
  
    <apex:form >
    <apex:pageBlock title="Enter {!account.name}'s Needs">
    
    <apex:pageblockButtons >
        <apex:commandButton value="Save" action="{!save}"/>
    </apex:pageblockButtons>

    <!-- Bound to CheckBox - works fine -->
    <apex:inputField value="{!account.Cut_Home_Phone_Costs__c}"/>

    <!-- bound to textbox - works fine -->
    <apex:inputField value="{!account.Home_Phone_Type__c}" />

    <!-- Bound to picklist - fails on Person Account - works on Business account -->
    <apex:inputField value="{!account.Home_Phone_Provider_Other__c}" />
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

Any suggestions?

 

Thanks,

Peter

 

AhmedPotAhmedPot

Hi,

 

There are many other threads with same issue reported.

 

What I found that this seems to be some problem from SF side

 

Just check the below link for more info

http://forums.crmsuccess.com/t5/Visualforce-Development/Visualforce-page-causing-validation-error-on-Person-Accounts/td-p/244675

 

Thanks,

Ahmed

 

dfiredfire

On the thread that Ahmed posted, there is a link to a work around by Quinton Wall, although I couldn't get that to work for me.

 

We had the same problem and I just used <apex:SelectList><apex:SelectOptions> and created the lists in the controller. Not very elegant I know, but our picklists don't change so much and I didn't want to write SOQL to get every picklist we needed because of govenor limits concerns.