Guest User

Untitled

a guest
May 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <apex:pageBlock Title="edit Account">
  2.  
  3. <apex:pageMessages />
  4. <apex:pageBlockSection Title="Information" columns="2">
  5. <apex:inputText label="First Name" value="{!fname}" id="fname"/>
  6. <apex:inputText label="Last Name" value="{!lname}" id="lname" html-
  7. placeholder="{!acc.LastName}"/>
  8. <apex:inputText label="Email" value="{!acc.Personemail}" id="email"
  9. html-placeholder="{!acc.personEmail}"/>
  10.  
  11. </apex:pageBlockSection>
  12. <apex:commandButton Value="Save" action="{!saving}"/>
  13. </apex:pageBlock>
  14.  
  15. Id accId;
  16. public Account acc {get;set;}
  17. public string fname {get;set;}
  18. public string lname {get;set;}
  19.  
  20.  
  21.  
  22.  
  23. public AccController() {
  24.  
  25.  
  26. accId = ApexPages.currentPage().getParameters().get('accId');
  27.  
  28. if (accId == null) {
  29.  
  30. acc = new Account();
  31.  
  32. return;
  33.  
  34. }
  35.  
  36. acc = [select id, FirstName, LastName, BillingCity, BillingStreet,BillingPostalCode, BillingCountry, PersonEmail
  37.  
  38. from Account
  39.  
  40. where id = :accId];
  41.  
  42.  
  43.  
  44. }
  45.  
  46.  
  47.  
  48. public PageReference saveThis() {
  49.  
  50.  
  51.  
  52. acc.FirstName = fname;
  53. acc.LastName = lname;
  54. acc.PersonEmail = acc.Personemail;
  55.  
  56. update acc;
Add Comment
Please, Sign In to add comment