Executing from a FLOW or Apex Class

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. 

Screenshot 2025-02-28 at 2.14.27 PM.png

Since this will be making a callout, add a Scheduled Path

Screenshot 2025-02-28 at 3.32.36 PM.png

Next add Flow Elements to retrieve the Connector Id and Connector Function Id.

Screenshot 2025-02-28 at 3.34.05 PM.png

Add an Action Element to call the Invocable Method that makes the callout. Search for 'Nexus' actions.

Screenshot 2025-03-03 at 1.37.34 PM.png

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.

Screenshot 2025-02-28 at 3.35.04 PM.png

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.  

Screenshot 2025-02-28 at 3.19.38 PM.png

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.

 

 

Was this article helpful?
0 out of 0 found this helpful