Skip to content

Instantly share code, notes, and snippets.

@paustint
Created March 24, 2018 00:10
Show Gist options
  • Save paustint/0238f42fa39b23b1641b0b6a6b68fd9f to your computer and use it in GitHub Desktop.
Save paustint/0238f42fa39b23b1641b0b6a6b68fd9f to your computer and use it in GitHub Desktop.
({
// example helper function
getQuoteLines: function(component, quoteId, quoteLineId) {
return new Promise(function (resolve, reject) {
var action = component.get("c.getQuoteLines");
action.setCallback(this, function(results) {
utils.log('getQuoteLines() results', results);
if(results.getState() === 'SUCCESS') {
utils.log('results:', results.getReturnValue());
resolve(results.getReturnValue());
} else if (results.getState() === 'ERROR') {
utils.log('getQuoteLines() ERROR', results.getError());
$A.log("Errors", results.getError());
reject(results.getError());
}
});
$A.enqueueAction(action);
});
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment