Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- createAccount : function(component, Account) {
- console.log('inside helper');
- var action = component.get("c.saveAccount");
- console.log('after method called ');
- action.setParams({
- "Account": Account
- });
- action.setCallback(this, function(response){
- var state = response.getState();
- if (component.isValid() && state === "SUCCESS") {
- var accounts = component.get("v.accounts");
- accounts.push(response.getReturnValue());
- component.set("v.accounts", accounts);
- }
- });
- $A.enqueueAction(action);
- },
- public class NewAccountHandler {
- @AuraEnabled
- public static Account saveAccount(Account Account) {
- system.debug('***--' + Account);
- upsert Account;
- system.debug('***--1' + Account);
- return Account;
- }
Add Comment
Please, Sign In to add comment