Work with Relations in Salesforce


Salesforce objects are related to each other. This article explains how to work with these relations.

When creating or updating Salesforce objects using Semarchy xDI, relations are established using a Salesforce identifier when it is known. You can also use external identifiers and integrate them with Semarchy xDI.

External ID Example

In this example, a Related_Account field is added to the t_customer object. This is a Lookup field that relates to the Account object.

relations related account

The reverse-engineered t_customer object metadata reflects that field:

relations metadata

The Account object is also customized with a custom ext_id field, declared as an External ID:

relations ext id

relations account data

To integrate t_customer data with values for the external identifiers (24, 27, 97, etc.), while loading the related account reference, you must add the FKEXTID_FIELD_NAME.ext_idc tag to the Related_Accountc field mapping:

relations tag

This tag, specific to the Salesforce Component, tells the template to load the external ID as well, is composed of:

  • The FKEXTID_FIELD_NAME constant prefix

  • The API name of the external ID field in the related object. In that case ext_id__c.

If your object does not have an external ID and is based on a Salesforce ID, you do not need to add the tag. Salesforce will automatically match the value with the master object’s ID.

As a result, the Salesforce object is created/updated with the expected relation to the Account object:

relations result