I am overriding person account standard Page with VF page. If I use standard controller as "Account" I am unable to get Picklist field values from "Person Account", If I use "Contact" as a Standard Controller I will get all picklist field value but can not Override "New" button in standard "Account" object.
This is my visualforce Page
<apex:page standardController="Contact" extensions="Account_ext" tabStyle="account" sidebar="false" >
<apex:form >
<apex:pageBlock title="Person Contact Edit">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
<apex:commandButton value="Save & New" />
</apex:pageBlockButtons>
<Apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputlabel value="First Name"/>
<apex:outputpanel >
<apex:outputfield value="{!Contact.Salutation}" />
<apex:outputfield value="{!Contact.FirstName}" />
</apex:outputpanel>
</apex:pageBlockSectionItem>
<apex:inputField value="{!Contact.lastname}"/>
<Apex:inputField value="{!Contact.Lead_Source__c}" />
<apex:inputField value="{!Contact.Enquiry_Budget__c}"/>
<apex:inputField value="{!Contact.Enquiry_check__c}"/>
<apex:inputField value="{!Contact.Enquiry_Flat_Type__c}"/>
<apex:inputField value="{!Contact.Enquiry_Locality_Preference__c}"/>
<apex:inputField value="{!Contact.Enquiry_Location__c}"/>
<apex:inputField value="{!Contact.Enquiry_Name__c}"/>
<apex:inputField value="{!Contact.Enquiry_Potential_Name__c}"/>
<apex:inputField value="{!Contact.Enquiry_Property_Type_Preference__c}"/>
<apex:inputField value="{!Contact.Enquiry_Type_Of_Purchase__c}"/>
<apex:inputField value="{!Contact.Lead_Source__c}"/>
<apex:inputField value="{!Contact.Mailing_City__c}"/>
<apex:inputField value="{!Contact.Mailing_Country__c}"/>
<apex:inputField value="{!Contact.Mailing_State_Province__c}"/>
<apex:inputField value="{!Contact.Mailing_Street__c}"/>
<apex:inputField value="{!Contact.Mailing_Zip_Postal_Code__c}"/>
<apex:inputField value="{!Contact.Opportunities__c}"/>
<apex:pageBlockSectionItem >
<apex:outputLabel >Project</apex:outputLabel>
<apex:selectList multiselect="false" size="1" value="{!Contact.Project__c}">
<apex:selectOptions value="{!prj}" />
</apex:selectList>
</apex:pageBlockSectionItem>
</Apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
This is my Controller as of Now still work is on.....
public class Account_ext {
public Account_ext(ApexPages.StandardController controller) {
}
public string prj;
List<selectOption> options = new List<selectOption>();
public List<selectOption> getprj() {
for(project__c acc : [select Id,name from project__c])
{
options.add(new selectOption(acc.name,acc.name));
}
return options;
}
}