Using the Salesforce Bulk API

In this section:

The standard Salesforce methods for creating, inserting, and updating Salesforce objects can be problematic for large data volumes. In addition, depending on the type of account, Salesforce limits the number of API calls and logins permitted.

The Salesforce Bulk API allows you to quickly load your organization’s data into Salesforce from CSV or XML files.

To use the Bulk API, you first create a job which results in a job ID. Then you add one or more batch to the job, identified by the Job ID. The result for each batch is a Batch ID. When all the batches are added, close the job and the batches will run in the background. You can check the status of the job and get results from the batches.

With DataMigrator use of the Bulk API is simplified because you do not have to write XML and Batch files. Instead you create flows, and the Job ID is passed from one flow to the next as a target, which is then used as a source in a JOIN to the next phase.

For more information, see the Salesforce Bulk API Developer’s Guide.


Top of page

x
Creating Synonyms for the Salesforce Bulk API

To use the Batch API, you need to create synonyms for each of the Batch API methods.

  1. Right-click an IWAF connection for Salesforce and select Create Synonym.

    The Select Synonym Candidates for IWAF window opens. Salesforce business objects are listed under the Synonym Candidates folder.

  2. Expand the Batch API folder. The methods for the Batch API are listed under the node.
  3. Select CreateJob and then click the Create Synonym button, as shown in the following image.

    Create Job Example

    The Create Synonym for IWAF window opens.

  4. Select an Application Directory where you want to store the synonym. Click Create Synonym.

    The Status window opens.

  5. Click Close.
  6. Repeat this procedure for all the Batch API methods.

Top of page

x
Adjusting the Field Widths in Synonyms

The synonyms created for Salesforce objects are based on an xsd (XML Schema Definitions) from the IWAF adapter. Unfortunately they do not include the length of the elements. The default length is 20 characters, but that is not enough in many instances.

For example, the full location and name of an input and output files will likely be more than 20 characters. There are file name parameters in the synonyms for AddBatch and GetBatchResults that should be changed.

  1. In the browser, double-click on addbatch to open it. If you are not in the Field View tab, click on it.

    If the properties panel is not displayed click the button

  2. Click the FILE field. In the properties panel, change the ACTUAL value from A20 to a larger value, such as A40. Note that the USAGE value is automatically changed to match, as shown in the following image.

    Properties

  3. Click the Save button to save the synonym.
  4. Repeat this procedure for getbatchresults.

WebFOCUS