+ Start a Discussion
Akhil Mirthipati 2Akhil Mirthipati 2 

Create a Visual force page ‘AccountUpdate’ .This page should display a form having Account Name, Account Number, Type, and Site fields. There should be ‘Save ‘button on the page. On clicking on save, the fields should be saved as an Account record.

Best Answer chosen by Akhil Mirthipati 2
Karan Shekhar KaulKaran Shekhar Kaul
Hi Akhil,

VF page:

<apex:page showHeader="true"  standardController="Account">
    <apex:form >
    <apex:pageBlock title="Account Update">
        <apex:pageBlockSection title="Account Details">
            <apex:inputField value="{!account.Name}"/>
           <apex:inputField value="{!account.AccountNUmber}"/>
           <apex:inputField value="{!account.Type}"/>
           <apex:inputField value="{!account.Site}"/>
        </apex:pageBlockSection>
        <apex:commandButton value="Save" action="{!save}"/>
    </apex:pageBlock>
    
    
    </apex:form>
</apex:page>

If you use this page with this URL "https://<domain>/apex/AccountUpdate" , it will create a new Account
if you use this page with this URL "https://<domain>/apex/AccountUpdate?Id=0012800001IVL0w" , it will update that Account

All Answers

Karan Shekhar KaulKaran Shekhar Kaul
Hi Akhil,

VF page:

<apex:page showHeader="true"  standardController="Account">
    <apex:form >
    <apex:pageBlock title="Account Update">
        <apex:pageBlockSection title="Account Details">
            <apex:inputField value="{!account.Name}"/>
           <apex:inputField value="{!account.AccountNUmber}"/>
           <apex:inputField value="{!account.Type}"/>
           <apex:inputField value="{!account.Site}"/>
        </apex:pageBlockSection>
        <apex:commandButton value="Save" action="{!save}"/>
    </apex:pageBlock>
    
    
    </apex:form>
</apex:page>

If you use this page with this URL "https://<domain>/apex/AccountUpdate" , it will create a new Account
if you use this page with this URL "https://<domain>/apex/AccountUpdate?Id=0012800001IVL0w" , it will update that Account
This was selected as the best answer
Akhil Mirthipati 2Akhil Mirthipati 2
hi karan can u give ur mail id i want to talk with you its very urgent... pls