Using The Upsert Operation For TIBCO Scribe® Insight Salesforce Integrations

Using The Upsert Operation For TIBCO Scribe® Insight Salesforce Integrations

book

Article ID: KB0078863

calendar_today

Updated On:

Products Versions
TIBCO Scribe Insight -

Description

When using Salesforce as a target, the Upsert operation can help reduce API calls. The Upsert call uses either the entity primary key or a custom field, set as type External ID, to determine whether to create a new record or update an existing record. If the External ID matches the source record, the target record is updated. If the External ID does not match any target record, a new record is created. The Upsert logic eliminates the need for a Seek Step to locate existing records and eliminates that extra API call.

The External ID field is a custom field that must be set up in Salesforce by an administrator. Each entity that you intend to modify must have its own External ID field. If there is more than one External ID field for an entity, you must indicate in the DTS which External ID field will be used for Upsert operations.

If the Salesforce entity has multiple External ID fields, then you must tell TIBCO Scribe® Insight which field to use for Upsert operations.
TIBCO Scribe® Insight adds a virtual field named UseAsExternalId when two or more External ID fields exist. Specify the external id field name as a string (e.g. “Person_ID__c”)
 

Configuring The External ID In Salesforce
 

NOTE: Each entity that you plan to modify using the Upsert operation must have an External ID field.
  1. Log into your Salesforce account.
  2. Navigate to Setup > Customize.
  3. Select an entity from the list.
  4. Select the Fields option for that entity. Either use an existing field or create a new one. Typically you would create a new custom field.
  5. If you create a new custom field, do not use the External Relationships Lookup data type.Select a standard data type, such as text.
  6. For either a new custom field or an existing field, enable the External ID option on the Field Properties. Typically you would create a new field.
 
kA2320000004GmOCAU_en_US_1_0
 
 
kA2320000004GmOCAU_en_US_1_1
 

Configuring The DTS
 

  1. Log into the TIBCO Scribe® Insight Workbench.
  2. Open the DTS that uses Salesforce as a target.
  3. If you added custom fields in Salesforce, you need to reset metadata to see those changes in TIBCO Scribe® Insight. Open the Connection Manager, select the Salesforce connection, and click Edit.
  4. On the Connection Settings dialog click the DTS Connection Settings tab.
  5. Click the Adapter Settings button.
  6. On the Adapter Settings dialog click Refresh Metadata.
  7. Click OK on Adapter Settings.
  8. Click OK on Connection Settings.
  9. Click Close on Connection Manager.
 
kA2320000004GmOCAU_en_US_1_2
 
  1. Click the Configure Steps button above the Target pane in the Workbench.
  2. Add a single Upsert Step. Upsert determines if an insert or update is required
  3. On the Configure Steps Operation tab, enable the Use Bulk Mode option. Bulk Mode reduces the number of API calls.
NOTE: Review the number of API calls used by logging into Salesforce and selecting Setup > Company > Company Information.
 
 
kA2320000004GmOCAU_en_US_1_3
 
  1. Map the Fields between the two entities.
  2. When you are done mapping, run your DTS.
 
kA2320000004GmOCAU_en_US_1_4
 

Using Seek, Insert, And Update Steps
 

There are some entities that do not support Upsert. In those cases, create a DTS using the traditional Seek, Insert, and Update Steps.
The Seek Step does not support Bulk operations, therefore it uses one API call for each record. To get around needing to use a Seek step, either keep a cross reference table or update the source with the Salesforce primary key when the record is first created in Salesforce. This way any subsequent updates can be made without using a Salesforce Seek Step.

For additional information on cross reference tables see About Cross Reference Keys in the TIBCO Scribe® Insight Help.




 

Issue/Introduction

When using Salesforce as a target, use Upsert operation to help reduce API calls.