Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. createAccount:function(component,event,helper){
  2. var newAccount=component.find("newAcc");
  3. var valueName=component.find("inputNameSample2").get("v.value");
  4. var valueIndustry=component.find("Industryselect").get("v.value");
  5.  
  6.  
  7. var action3=component.get("c.createAccount");
  8. action3.setParams({
  9. "paramName":valueName,
  10. "paramIndustry":valueIndustry
  11.  
  12. });
  13. action3.setCallback(this,function(res){
  14. var state1=res.getState();
  15. if(state1=="SUCCESS"){
  16. document.getElementById("NewAccountForm").style.display="none";
  17.  
  18. }
  19. });
  20. $A.enqueueAction(action3);
  21.  
  22. },
  23.  
  24. @AuraEnabled
  25. public static Account createAccount(String paramName,String paramIndustry) {
  26. Account acc = new Account(Name = paramName,Industry = paramIndustry);
  27. upsert acc;
  28. return acc;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement