I am a newbie in this field. First time trying to code a VisualForce page.
I have created a custom object named 'Order'. Added one custom field named 'Account' which is referencing to an account object. I would like to override the default New button with my own VF page.
This is my controller code:
public class orderExtension {
private final Order__c order;
public orderExtension (ApexPages.StandardController stdController) {
order = (Order__c) stdController.getRecord();
}
}
This is my VF page code:
<apex:page standardController="Order__c" extensions="orderExtension">
<apex:sectionHeader title="Order Edit" subtitle="New Order"/>
<apex:form >
<apex:pageBlock title="Order Edit" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton value="Save and Add Products" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Order Information" columns="2">
<apex:inputField label="Account" value="????"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Could you please assist me with the inputField? Code samples will be appreciated.