Salesforce - Trigger Configuration (Magic xpi 3.x)
The Salesforce connector can be used to trigger a flow as a result of objects changed in Salesforce. When you drag the Salesforce connector into the Magic xpi Studio’s trigger area, the Component Properties dialog box opens. Click Configuration to open the Salesforce Trigger Configuration dialog box.
This dialog box contains the following fields:
|
|
Connection
|
Resource Name
|
This read-only field displays the name(s) of the Salesforce resource(s) that you selected for the trigger in the Service Repository.
|
Polling Interval
|
Click to open the Polling Interval dialog box. Enter the frequency that the connector will check for changes in your organization's data. You can select a combination of minutes, hours, and days.
Note:
|
Salesforce.com recommends that the interval between polls be set to at least five minutes.
|
The value that you set here (for example, three minutes) determines the number of real calls that are made to the Salesforce API. This mechanism works in the following way:
-
The trigger can call two Salesforce methods: GetUpdated() and GetDeleted(), depending on the trigger configuration.
-
Each call to these methods returns an ID list of the changed or deleted objects.
-
When Magic xpi gets the list of IDs, it uses the Retrieve() call to retrieve the objects' fields. The call to retrieve is done in a chunk of 2000 IDs in a single retrieve call. If there are more than 2000 changes, then Magic xpi calls to retrieve again with the min(records left, 2000) function, until all of the IDs are retrieved.
-
Therefore, if you have, for example, 1000 updated/created objects every three minutes, then you will get two calls: GetUpdated() and Retrieve().
|
Synchronous
|
Select this check box to synchronize the retrieval of trigger lines and to determine their invocation order. This enables you to control situations where there is a relationship between triggered lines. For example, you might have a parent/child relationship where the data extracted from Salesforce is inserted to several database tables. If the trigger is not synchronized, the child lines could be inserted before the parent record, which would cause an SQL error.
The default is unchecked.
You can use the up and down arrows on the right-hand side of the dialog box to determine the correct processing order of the trigger lines.
Since version: V3.2 SP1
|
Keep Alive Interval
|
The amount of time in minutes that the trigger can be unresponsive before it is automatically restarted. The default value is 0, which means that the trigger can be permanently unresponsive.
Note:
|
-
You should be very careful when selecting a value for this parameter. If the chosen value is too small, a trigger may terminate before it completes a valid operation.
-
If you select the Synchronous check box (above), the trigger and the flow will operate in the same thread. This means that if the trigger is terminated because it is unresponsive, the flow will be terminated as well. Therefore, when setting the Keep Alive Interval parameter, you should also take into account the amount of time it takes for the flow to run. For example, if the trigger's unresponsive time is three minutes, and the flow takes a maximum of two minutes to run, then you should set the Keep Alive Interval parameter to a value of more than five minutes.
|
Since version: V3.2 SP2
|
Row Label
|
Enter a label to define the triggered row. The variable mapped in the Store Row Label In field (below) holds the label value when the flow is invoked.
|
Object
|
Click to open the Objects List. Select the object that the operation will be performed on. This list is generated when you click the Object List button in the Salesforce Resource dialog box.
Note:
|
The objects list has to be built in the resource; otherwise, you will not be able to get the objects list in the step or trigger.
|
|
Operation
|
Select one of the following operations from the drop-down list:
-
Updated (default): This is used to retrieve the list of individual objects that have been updated (added or changed).
-
Deleted: This is used to retrieve a list of individual objects that have been deleted.
|
Start Date
|
Click to open the Variables List. Choose the required start date for the retrieval of the data. You can only use global variables in this field.
Note:
|
The required format for this parameter is the XML DateTime format. You can use Magic xpi's DateTimeFormat function to create valid start dates.
|
|
Result Store Options
|
Store XML Result In
|
This field is used to store the trigger’s polling results.
Click to open the Variables List. Choose the required BLOB variable by clicking Select. The default is UserBLOB.
|
Store Row Label In
|
This field is used to store the trigger’s row label.
Click to open the Variables List. Choose the required Alpha variable by clicking Select.
|
Store Last Date In
|
This field holds the last date and time that the trigger found a change (when an object was deleted, updated or added).
Click to open the Variables List. Choose the required Alpha variable by clicking Select.
|
Note:
|
-
Results can be returned for no more than 30 days prior to the day that the polling is executed. Data can be retrieved only for objects to which the logged-in user has access. For retrieving results over longer periods, you should use the step query mechanism, as described here.
-
The Userstring will hold data in the following structure: <label> - <object name> - <operation> (deleted/updated).
|
The Salesforce Trigger Configuration dialog box contains the following additional buttons:
|
|
Refresh XSD
|
Retrieves the object schema for all selected objects.
|
New
|
Creates a new line in the trigger table.
|
Delete
|
Deletes a selected line in the trigger table.
|
When you have finished configuring the connector, click OK to create the Salesforce schemas for all selected objects, and to close the Salesforce Trigger Configuration dialog box.
Alternatively, you can click Cancel to close the Salesforce Trigger Configuration dialog box without saving your definitions.
Then click the Component Properties dialog box’s OK button to close the dialog box and to save your configuration settings.