I've a Account object as a Parent Object & contact as Child. I created a Vf page for Account Object. Now I've to create the Child Object record from this Page. How to create the child Record.
When I click on save button my account record will update and rescpective conatct record should create. So Here how to create the contact record.
My VF page as Below :
<apex:page standardController="Account">
<apex:pageBlock >
<apex:form >
<apex:pageBlockSection >
<apex:outputField value="{!Account.Name}"/>
<apex:outputField value="{!Account.AccountNumber}"/>
<apex:outputField value="{!Account.Phone}"/>
<apex:outputField value="{!Account.Type}"/>
<apex:outputField value="{!Account.Rating}"/>
<apex:outputField value="{!Account.SLA__c}"/>
<apex:inlineEditSupport />
<!-- Insert the Contact field here when click on Save button Account will update & the contact record will create -->
<apex:inputField value="{!Contact.lastname}"/> <!-- I've to inisert the Contact record from here but this syntax showing error Error: Unknown property 'AccountStandardController.Contact' -->
<apex:commandButton value="Save" Action="{!Save}"/>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>