Create a Visual force page that should display Account Name, Phone and Industry fields of Account. There should be a Save button on the page. After filling the values in fields and clicking on save, the account should get saved
Hi Akhil, If you need to complete this request using custom controller for the same functionality ,use this code VF Page <apex:page showHeader="true" Controller="AccountController_CC"> <apex:form > <apex:pageBlock title="Account Update"> <apex:pageBlockSection title="Account Details"> <apex:inputField value="{!acc.Name}"/> <apex:inputField value="{!acc.Phone}"/> <apex:inputField value="{!acc.Industry}"/> </apex:pageBlockSection> <apex:commandButton value="Save" action="{!saveRecord}"/> </apex:pageBlock> </apex:form> </apex:page>
Controller : class AccountController_CC { public Account acc{get;set;} public AccountController_CC() { acc=new Account(); }
public void saveRecord() { insert acc; }
}
you can send me an email for any further details at shivarv1993@gmail.com .
class AccountController_CC
{
public Account acc{get;set;}
public AccountController_CC()
{
acc=new Account();
}
public void saveRecord()
{
insert acc;
}
}
you can send me an email for any further details at shivarv1993@gmail.com .
public class controllerAccount {
public Account Myacc{get;set;}
public controllerAccount()
{
Myacc=new Account();
}
public void showDebug(){
System.debug('your info is '+Myacc);
}
}
Below is the solution of your question: Hope this might help you.
Regards,
Akshay
Use below code for VF Page.
Let me know the outcome.
Thanks,
Amit Singh
If you need to complete this request using custom controller for the same functionality ,use this code
VF Page
<apex:page showHeader="true" Controller="AccountController_CC">
<apex:form >
<apex:pageBlock title="Account Update">
<apex:pageBlockSection title="Account Details">
<apex:inputField value="{!acc.Name}"/>
<apex:inputField value="{!acc.Phone}"/>
<apex:inputField value="{!acc.Industry}"/>
</apex:pageBlockSection>
<apex:commandButton value="Save" action="{!saveRecord}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller :
class AccountController_CC
{
public Account acc{get;set;}
public AccountController_CC()
{
acc=new Account();
}
public void saveRecord()
{
insert acc;
}
}
you can send me an email for any further details at shivarv1993@gmail.com .
Thanks and Regards,
Shiva RV
If you need to complete this request using custom controller for the same functionality ,use this code
VF Page
Controller :
you can send me an email for any further details at shivarv1993@gmail.com .
Thanks and Regards,
Shiva RV
VisualForce page
Controller