Mapping Custom Salesforce Objects
You can use the Salesforce Export API (SFORCE_export_mapping*.csv) to map ClientSpace forms and fields to Salesforce objects and fields and export the data from ClientSpace to Salesforce to create new Salesforce objects.
Step 1: Verify Datatypes
Before you get started, make sure you verify the datatypes of the fields you want to map in Salesforce and ClientSpace. Mapped fields must have matching datatypes.
-
In Salesforce: Go to Setup >Object Manager > Select Object >Fields And Relationships.
-
In ClientSpace: Go to System Admin > Advanced > Dataform Admin. Open the dataform and select Fields. Hover your mouse pointer over a field in the Field column to view the datatype.
Step 2: Add the "AdditionalInsertExportList" Parameter to the Salesforce API Record
The AdditionalInsertExportList parameter must be added to the Salesforce API record (SFDCDEV or SFDCPROD) to specify which ClientSpace forms are allowed to be inserted into Salesforce.
Note: In development sites, the Salesforce API name will be SFDCDEV. In production sites, the Salesforce API name will be SFDCPROD.
To add the parameter:
- Go to System Admin > Advanced > API Configuration.
The API Configuration dashboard opens. - Select the Salesforce API record (SFDCDEV or SFDCPROD) and click Edit.
The API Configuration form opens. - Add the Parameter and add the form names (table names) to the Value field as shown below. Separate them by a semicolon if there is more than one.
- Click Apply or Save.
Step 3: Review Import Map Header Detail of the Salesforce Export API Record
The export process that inserts custom Salesforce objects uses the existing Salesforce Export API (SFORCE_export_mapping*.csv). If you are already using the Salesforce Export API to update Salesforce objects, it will already be configured for you. You can review the API settings and make changes if necessary.
To review the Salesforce Export API settings:
- Go to System Admin > Advanced > Configure Import.
The Import Map Header Search dashboard opens. - Enter SFORCE in the Search field and click Search.
- Click (Open) next to SFORCE_export_mapping*.csv or double-click the row.
The Import Map Header Detail form displays Salesforce Export API configuration as shown in the example below.
- Review the field values. Note that the Import Type should be set to Both. For a complete list of field definitions, refer to Configuring the Import Map Header.
- If you made changes, click Save.
Step 4: Configure the Import Map Detail Record of the Salesforce Export API Record
In this step, add each field from ClientSpace that you want to send to a Salesforce object (i.e., form) and field.
To configure the Salesforce Export API mapping:
- Open the Salesforce Export API Import Map Header Detail record. (See Step 2 for details.)
- In the right pane, click Fields.
The Import Map Search dashboard opens. - To add fields, click Add.
The Import Map Detail form opens. - Map the fields as shown in the example image below. Refer to Configuring the Import Map Detail for detailed steps and a list of all field descriptions.
How the Export Determines Whether to Insert or Update a Salesforce Object
When a change is made to a dataform with mapped fields, an audit record is created containing the change. When the Salesforce Scheduled Process (Salesforce Sync Rest API) runs, ClientSpace uses the External Source Linking table (System Admin > Imports > External Source Linking) to determine whether to update or create an object. The External Source Linking dashboard displays a list of all API objects. If you open an External Source Linking record and see entries for both a Clientspace Table Name/ClientSpaceID pair along with an External Object (i.e., Salesforce object)/External Object ID pair, this means that there is already a link between the objects in Salesforce and ClientSpace.
If a change is made on the associated ClientSpace dataform, the audit record contents are used to update the object in Salesforce the next time the scheduled process runs. If no Clientspace Table Name/ClientSpaceID pair and External Object/External Object ID pair are shown on the External Source Linking record, a new object will be inserted using the contents of the audit record the next time the scheduled process runs.