Skip to content

Instantly share code, notes, and snippets.

@xgeek-net
Created January 6, 2019 07:16
Show Gist options
  • Save xgeek-net/f1c2aa689f35fd7711bb55eca46a6f94 to your computer and use it in GitHub Desktop.
Save xgeek-net/f1c2aa689f35fd7711bb55eca46a6f94 to your computer and use it in GitHub Desktop.
SampleAuraController Lightning Component
({
'showAccount' : function(cmp, ev, helper) {
var action = cmp.get('c.findAccount');
action.setParams({ accountId : '001xxxxxxxxxxxx' }); // your parameters
action.setCallback(this, function(res) {
var state = res.getState();
if(state === 'SUCCESS') {
console.log('From Server-Side: ' + res.getReturnValue());
}
else if(state === 'ERROR') {
console.error('ERROR: ' + res.getError());
}
});
$A.enqueueAction(action);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment