Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:pageBlock Title="edit Account">
- <apex:pageMessages />
- <apex:pageBlockSection Title="Information" columns="2">
- <apex:inputText label="First Name" value="{!fname}" id="fname"/>
- <apex:inputText label="Last Name" value="{!lname}" id="lname" html-
- placeholder="{!acc.LastName}"/>
- <apex:inputText label="Email" value="{!acc.Personemail}" id="email"
- html-placeholder="{!acc.personEmail}"/>
- </apex:pageBlockSection>
- <apex:commandButton Value="Save" action="{!saving}"/>
- </apex:pageBlock>
- Id accId;
- public Account acc {get;set;}
- public string fname {get;set;}
- public string lname {get;set;}
- public AccController() {
- accId = ApexPages.currentPage().getParameters().get('accId');
- if (accId == null) {
- acc = new Account();
- return;
- }
- acc = [select id, FirstName, LastName, BillingCity, BillingStreet,BillingPostalCode, BillingCountry, PersonEmail
- from Account
- where id = :accId];
- }
- public PageReference saveThis() {
- acc.FirstName = fname;
- acc.LastName = lname;
- acc.PersonEmail = acc.Personemail;
- update acc;
Add Comment
Please, Sign In to add comment