Retrieving Salesforce records (no discovery)

Use the SalesforceRequest (no discovery) node to retrieve records from the Salesforce system.

About this task

Note: SalesforceRequest (no discovery) is the new name for the node that was called SalesforceRequest in previous versions of IBM® App Connect Enterprise (up to and including V12.0.4), and it continues to operate in the same way as in previous versions.

In IBM App Connect Enterprise 12.0.5 (and later versions), a new Salesforce Request node is provided, which you configure by using a Connector Discovery wizard to discover and set properties for the Salesforce connector. For information about using this feature, see Using Salesforce with IBM App Connect Enterprise and Salesforce Request node.

You can retrieve Salesforce records by specifying Retrieve in the Operation property of the SalesforceRequest (no discovery) node. You can retrieve all records of a particular type by specifying the object type in the Salesforce object property of the node. This object type can be overridden by a value specified in the LocalEnvironment.Destination.Salesforce.Request.object local environment variable.

Alternatively, you can retrieve a specific record by specifying a Salesforce ID in the LocalEnvironment.Destination.Salesforce.Request.id environment variable. The returned record appears as a JSON object in the location that is specified by the Output data location property of the node.

If an external ID name and value are specified in the LocalEnvironment.Destination.Salesforce.Request.externalIdName and LocalEnvironment.Destination.Salesforce.Request.externalId environment variables, all records with that external ID are returned. The returned records appear as a JSON array in the location specified by the Output data location property.

If neither a Salesforce ID nor an external ID is specified, all records of the specified type are returned by default.

You can control the records that are returned by using the LocalEnvironment.Destination.Salesforce.Request.filter environment variable to specify a filter with one of the following clauses:
  • where
  • limit
  • skip
  • order
  • field

You can control which records are returned by specifying a filter with a where, limit, or skip clause. If no ID has been specified, this filter is used to select the records to be returned.

If you specify a filter with an order clause, the records are returned in the specified order. For more information, see Filtering the records retrieved from Salesforce (no discovery).

You can also restrict the records that are returned by specifying a filter with a field clause, so that only the specified field is returned. Filtering with a field clause optimizes performance by reducing unnecessary processing.

By default, the retrieval of records is determined by the following properties, in order of precedence:
  • Salesforce ID
  • External ID
  • Filter

If no Salesforce records are found, the output tree contains nothing under JSON.data.

JSON schema are supplied for a wide range of Salesforce objects, and you can use them as input and output for message maps in a Mapping node. For example, you can transform the message tree for a returned Salesforce Account record in a Mapping node by using the JSON schema for the Account object. For more information, see Using Salesforce models (no discovery).

Procedure

Follow these steps to retrieve Salesforce records:

  1. Set up a Salesforce account on Salesforce.com.
  2. Configure a connection to Salesforce.com.
  3. Create a flow containing a SalesforceRequest (no discovery) node, and set the following properties on the Basic tab:
    1. In the Salesforce URL property, specify the URL of the external Salesforce system.
    2. In the Operation property, specify Retrieve.
    3. In the Salesforce object property, select the type of Salesforce records that you want to retrieve.
    4. In the Security identity property, specify the security identity that you will use when connecting to the Salesforce system. For information about configuring the security identity on the integration node, see Configuring a secure connection to Salesforce.com (no discovery).
    5. In the Timeout property, specify the time (in milliseconds) that the node waits for Salesforce to process the operation.
    For more information, see SalesforceRequest (no discovery) node.
  4. Send the required message through the flow to the Salesforce system.
    You will receive a response from the Salesforce system to confirm that the records have been retrieved.

Example

See Example: Retrieving all Account records from Salesforce (no discovery) for a specific example of how to use the SalesforceRequest (no discovery) node to retrieve records from a Salesforce system.