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
Akis AthanasiadisAkis Athanasiadis 

Error on Contract Visualforce

I have created a visualforce page for contracts on create using the following code.
 
<apex:page standardController="Contract"  title="New Contract" >
    
    <apex:sectionHeader subtitle="New Contract"/>
    <apex:form >
        <apex:pageBlock mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                 
                <apex:commandButton value="Save" action="{!save}"/>
                
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
           
                 <apex:pageBlockSection title="Information"  columns="2">
                     
               <apex:pageblocksection columns="1">
                
                
                <!--<apex:inputField value="{!currentRecord.id}"  required="false" />-->
                <apex:inputField value="{!Contract.Account}"  required="true" />
                <apex:inputField value="{!Contract.End_Customer__c}"  required="false" />
                <apex:inputField value="{!Contract.Automatic_Renewal__c}"  required="false" />
                <apex:inputField value="{!Contract.Annual_Adjustment_Percentage__c}"  required="false" />
                <apex:inputField value="{!Contract.Vendor__c}"  required="false" />
                <apex:inputField value="{!Contract.Vat__c}"  required="true" />
                
                </apex:pageblocksection> 
                 
                <apex:pageblocksection columns="1">
                <apex:inputField value="{!Contract.Account_Executive__c}"  required="true" />
                <apex:inputField value="{!Contract.Renewal_Type__c}"  required="true" />
                <apex:inputField value="{!Contract.Payment_Terms__c}"  required="true" />
                <apex:inputField value="{!Contract.Invoice_Period__c}"  required="true" />
                <apex:inputField value="{!Contract.StartDate}"  required="false" />
                   
               </apex:pageblocksection> 
                 
               
               
            </apex:pageBlockSection>
            
            <apex:pageBlockButtons location="bottom">
                 
                <apex:commandButton value="Save" action="{!save}"/>
                
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
           
        </apex:pageBlock>
        
        
       

    </apex:form>
    
    
</apex:page>

I have assigned the VF page to the new button.
When I try to create a new contract I receive the following error message.

User-added image
When I comment the account field, the process is moving on.
Any ideas on how to resolve this?
Best Answer chosen by Akis Athanasiadis
Meghna Vijay 7Meghna Vijay 7
Hi Akis,
On Contract the API name for Account is AccountId not Account. 
Hope it helps, if it does mark it as solved.
Thanks