Salesforce

Salesforce - Trigger Configuration (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Salesforce - Trigger Configuration (Magic xpi 4.13)

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 Properties pane opens. Double-click or right-click on the connector and select Configuration from the context menu to open the Salesforce Trigger Configuration dialog box.

This dialog box contains the following fields:

Name

Description

Connection

Resource Name

This read-only field displays the name(s) of the Salesforce resource(s) that you selected for the trigger in the Settings dialog box's Services section.

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.

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.

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.

  • 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.

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.

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.

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 Options

Store XML Result In

Defines where you want to store the trigger’s polling results. Select one of the following from the drop-down list:

  • File: Saves the trigger result to a file. The resulting file name will be created according to the following logic: <LabelName>_<ObjectName>_<Operation>_<mTime>.xml. The label is optional. Therefore, if it is not provided, the file name should not start with an underscore.

  • Variable: Stores the polling results that are returned by Salesforce in a variable. Click to open the Variables List. Select a variable to hold the results. The default is C.UserBLOB. You can split the polling results according to how you define the Split Result, Max Number of Records, Result Folder Path, and Store Result File Name In properties (below).

Since version: 4.1

Split Result

Select this check box to enable the Max Number of Records property (below).

Since version: 4.1

Max Number of Records

The maximum number of records in each split file. Click to open the Expression Editor and enter the maximum number of records. The default number of records is 1000. If you enter 0, no split will be performed. This property is available only if you select the Split Result check box (above).

Since version: 4.1

Result Folder Path

The folder where the results will be stored. Click to open the Expression Editor and enter the folder name, or click and select the required folder. This property is available only if you select File in the Store XML Result In property (above).

Since version: 4.1

Store Result File Name In

The full path to the results file storage location. Click to open the Variables List. Choose the required Alpha variable by clicking Select. This property is available only if you select File in the Store XML Result In property (above).

Since version: 4.1

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.

  • 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:

Button

Description

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.

Reference
Attachment 
Attachment