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.
- Log into your Salesforce account.
- Navigate to Setup > Customize.
- Select an entity from the list.
- 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.
- If you create a new custom field, do not use the External Relationships Lookup data type.Select a standard data type, such as text.
- 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.
Configuring The DTS
- Log into the TIBCO Scribe® Insight Workbench.
- Open the DTS that uses Salesforce as a target.
- 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.
- On the Connection Settings dialog click the DTS Connection Settings tab.
- Click the Adapter Settings button.
- On the Adapter Settings dialog click Refresh Metadata.
- Click OK on Adapter Settings.
- Click OK on Connection Settings.
- Click Close on Connection Manager.
- Click the Configure Steps button above the Target pane in the Workbench.
- Add a single Upsert Step. Upsert determines if an insert or update is required
- 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.
- Map the Fields between the two entities.
- When you are done mapping, run your DTS.
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.