Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created November 23, 2018 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpluslabs/39625238b6fc72629d3e29cdd969d8d1 to your computer and use it in GitHub Desktop.
Save simpluslabs/39625238b6fc72629d3e29cdd969d8d1 to your computer and use it in GitHub Desktop.
({
getData : function(component, event) {
console.log('inside init getData');
var recId = component.get("v.recordId");
var dataAction = component.get("c.getAccount");
dataAction.setParams({accountId : recId});
dataAction.setCallback(this, function(response){
var state = response.getState();
if(state=='SUCCESS')
{
var retVal = response.getReturnValue();
console.log('retVal---'+retVal.Name);
component.set("v.account",retVal);
}
});
$A.enqueueAction(dataAction);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment