There are two 'Invocable Methods' included in the app that allow for making callouts using a Flow. The 'Make Nexus Function Call' would be used for executing from a single record, while the 'Make Nexus List Function Call' would execute as you would from the 'List Builder' tab. The difference in the two is the List function will take an optional 'WHERE clause' string input where the standard callout will take and optional 'Record Id' value.
Note: Refer to the Salesforce documentation if more information on using the Flow Builder is required.
In this example, we will build a Flow that will automatically create an Account in the external system using the API when the record is created in Salesforce.
Since this will be making a callout, add a Scheduled Path
Next add Flow Elements to retrieve the Connector Id and Connector Function Id.
Add an Action Element to call the Invocable Method that makes the callout. Search for 'Nexus' actions.
Set the Input Values to the Connector/Connector Function Ids from the Get Records elements and the Salesforce Record Id to the Triggering Account Id.
Once saved and activated, this Flow is ready to test.
Building a Flow for a List Function would need to have a different trigger for the Flow. Generally, automation of List Functions is done with a Scheduled Flow, or based on another event. The difference in building this Flow is that instead of having a Salesforce Record Id as a value like the 'Make Nexus Function Call' action, the 'Make Nexus List Function Call' has the option to enter the Where Clause as a filter for the query.
Using Apex
The code below shows how to execute Connector Functions from Nexus when making the call from an Apex class. The Invocable Methods available above can be used, but the method signatures are set up to list of 'connectorFunctionCall' or 'connectorListFunctionCall' objects as opposed to passing individual variables. These lists are only expecting a single instance of the object, so and list that has more than one element will ignore the additional values. Both classes are 'global' in the Nexus package.
The Standard Function callout method signature:
inxs.nexus_globalFunctionCall.nexus_FunctionCall(List<connectorFunctionCall> cfc);
The 'connectorFunctionCall' class consists of the Connector id, the Connector Function Id and an optional Base Record Id. Only one element is needed in the list of connectorFunctionCall objects.
global class connectorFunctionCall {
global string connectorId; //required
global string connectorFunctionId; //required
global string baseRecordId; //optional
}
The List Function callout method signature:
inxs.nexus_globalListFunctionCall.nexus_listFunctionCall(List<connectorListFunctionCall> clfc);
The 'connectorListFunctionCall' class consists of the Connector id, the Connector Function Id and an optional 'Where' clause to limit the results of the query. Likewise, since the system will make the query to retrieve the list of records, only one element is needed in the list of connectorListFunctionCall objects.
global class connectorListFunctionCall {
global string connectorId; //required
global string connectorFunctionId; //required
global string whereClause; //optional
}
If you have additional questions, please contact IOLITE Support.