Using asynchronous XHR calls in customized Lightning Components

Custom Lightning Components can make asynchronous calls, which can include calling a third-party API client using an XHR request. Also, you can read the navigation options configured by the admins, and navigate the Flow to the next screen.

The boilerplate code is as follows, and is used to detect all the available actions: 

var availableActions = component.get('v.availableActions);for (var i = 0; i < availableActions.length; i++) {   if (availableActions[i] == "PAUSE") {               } else if (availableActions[i] == "BACK") {   } else if (availableActions[i] == "NEXT") {   } else if (availableActions[i] == "FINISH") {   } }

To navigate back-and-forth, the boilerplate code is as follows:

 var actionClicked ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.