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
sfdeveloper9sfdeveloper9 

Person Account icon in VF page

we have person accounts enabled. I am trying to override Edit button to go to VF page.

Can we show Person Account Icon(person image) on the VF page instead of the regular Account icon(Folder image).

 

Thanks,

PK

aballardaballard

Where are you seeing the wrong icon?  There was a bug with this for folder tabs, but it should be fixed in the current release.

Is there somewhere else showing the wrong icon?

sfdeveloper9sfdeveloper9

I am overriding the account edit button with a VF Page. I was expecting to see folder icon for business accounts and person icon for person accounts. here is my vf page code

 

<apex:page standardController="Account" extensions="PerAccEditController" tabStyle="Account">
        <apex:sectionHeader title="{!$ObjectType.Account.label} Edit" subtitle="{!Account.name}" help="Help for this Page"/>
        <apex:form >
        <apex:pageBlock title="{!$ObjectType.Account.label} Edit" mode="edit">
                <apex:pageBlockButtons >
                        <apex:commandButton action="{!save}" value="Save"/>
                        <apex:commandButton  value="Save & New"/>
                        <apex:commandButton action="{!cancel}" value="Cancel"/>
                </apex:pageBlockButtons>
                <apex:pageBlockSection showHeader="true" title="Account Information" columns="2">
                        <apex:inputField required="true" value="{!Account.FirstName}"/>
                        <apex:pageBlockSectionItem >
                                <apex:outputLabel value="Account Owner"/>
                                <apex:outputText value="{!Account.Owner.Name}"/>
                        </apex:pageBlockSectionItem>
                        <apex:inputField required="true" value="{!Account.LastName}"/>
                        <apex:inputField required="true" value="{!Account.Contact_Method__pc}"/>     
                        <apex:inputField value="{!Account.Phone}"/>                     
                        <apex:inputField value="{!Account.PersonEmail}"/>
                        <apex:inputField value="{!Account.Personal_Information__c}"/>                       
                       
                </apex:pageBlockSection>
        </apex:pageBlock>
        </apex:form>
</apex:page>

aballardaballard

You are right.  This appears to be broken still for this page.  You should file a support case. 

 

aballardaballard

(If you do, tell support to refer to work item W-625604, which was supposed to have fixed this. )

sfdeveloper9sfdeveloper9

Thanks aballard. I will log a case and refer the work item you mentioned. I am facing one more issue

I have the account edit override going to a vf page. The page works fine for business accounts but person accounts I am getting the below error

"Record Type ID: value not valid for the entity: Account".

 

I get this error only if I have any custom picklist fields on the vf page. If I comment the line as shown every thing works fine. Please let me know if I am doing anything wrong

 

 

 

<apex:page standardController="Account" extensions="PerAccEditController" tabStyle="Account">
<apex:sectionHeader title="{!$ObjectType.Account.label} Edit" subtitle="{!Account.name}" help="Help for this Page"/>
<apex:form >
<apex:pageBlock title="{!$ObjectType.Account.label} Edit" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton value="Save & New"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection showHeader="true" title="Account Information" columns="2">
<apex:inputField required="true" value="{!Account.FirstName}"/>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Account Owner"/>
<apex:outputText value="{!Account.Owner.Name}"/>
</apex:pageBlockSectionItem>
<apex:inputField required="true" value="{!Account.LastName}"/>
<!--below line is giving the error-->
<!--apex:inputField required="true" value="{!Account.Contact_Method__pc}"/-->
<apex:inputField value="{!Account.Phone}"/>
<apex:inputField value="{!Account.PersonEmail}"/>
<apex:inputField value="{!Account.Personal_Information__c}"/>



</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

aballardaballard

There was a problem with inputfield for picklists in person accounts.   It should be fixed in the next (summer) release.