This page covers advanced options, advanced mapping functionality, and how to include headers in success/failure files using the Jitterbit Connect Salesforce Wizards.
Advanced options are accessible after you create a Salesforce operation. You can view the available options in Design Studio following these steps:
For select Bulk Process connectors (Upsert, Insert, Update, Delete, and Hard Delete), the Advanced Options > Batch Settings let you configure a setting that limits the number of records returned or used in a batch:
Use 0 or leave a field empty if there is no limitation on its value.
These settings (and the source and target chunk nodes, if applicable) can also be set at the operation level; if so, the window of the configured connector needs to be closed and reopened to see those changes in these settings.
Operation-level chunking is not available for Salesforce Bulk Process operations (instead, see the Batch Settings above). For other Salesforce operations, these operation options are available, as shown for a Salesforce Query operation:
Additional information on these settings and chunking in general is covered in Chunking.
For a configured connector's Advanced Options > Date Options, you can configure the Date Conversion Settings. This applies when mapping to Salesforce target fields with a
date-time data type, as described under Mapping to Salesforce Date or Date-Time Fields later on this page.
For a configured connector's Advanced Options > Retry Policy, you can configure Salesforce Ownership rules:
For a configured connector's Advanced Options > Retry Policy, you can configure:
As part of the Jitterbit Connect Salesforce Wizards, when completing certain mappings, Design Studio automatically creates mapping scripts that are common for certain use cases. These apply when mapping to Salesforce
date-time fields in a Salesforce upsert, insert, or update operation or bulk process of the same type, as well as when mapping a response from a Salesforce upsert, insert, update, or delete to another target.
This functionality applies when mapping from a specified source to a Salesforce target field that has a
date-time data type within a Salesforce upsert, insert, or update operation or a Salesforce bulk process operation that is of the upsert, insert, or update type. The source is specified during completion of the Jitterbit Connect Salesforce Wizard.
As an aid to the user, while completing a transformation mapping, any
date-time fields present in your source will be mapped with script logic that converts these fields to the format expected by Salesforce. The specific script logic that is added depends on the Date Conversion Settings as specified under the advanced Date Options described earlier on this page.
For example, assume that the source data is in the format of
YYYY-MM-DD HH:MM:SS and the source time zone is GMT. In this case, the default settings apply:
With this example, when a source field (
json$item.LastModifiedDate$) is mapped to a target
date-time field (
root$transaction.body$create$Account.LastModifiedDate$), script logic is automatically added to the target field. The added script uses the Jitterbit function
GetUTCFormattedDateTime() and specifies its parameters using the source field, specified time zone (
"UTC"), and boolean for the European date format (
The specific script logic that is inserted depends on the user-provided Date Conversion Settings. It is important that the source data be in a format able to be converted with the logic inserted based on these settings. For example, if you try to map from a source field that does not contain a date or date-time, it will not be able to be converted with this logic.
This functionality applies when mapping the response from Salesforce that is returned when, during creation of a Salesforce upsert, insert, update, or delete operation, on the Schedule & Options step, the Response Option checkbox for "I need to interact with the response from Salesforce" is selected. This option is selected by default.
As an aid to the user, when this option is selected, a second transformation is automatically added to the operation that generates a mapped script to capture any errors returned from Salesforce and write those errors to the operation log. The target of the transformation is a flat schema where the Salesforce error message is automatically mapped to a field containing a generated script to log the errors. In addition, for Salesforce upsert or update operations, the external key field is also recorded in the log.
For example, if this option is selected during creation of a Salesforce upsert operation, an operation similar to that shown below will be created. The operation includes both the initial, request transformation to perform the upsert, as well as a second, response transformation used to record the response from Salesforce:
Upon opening the response transformation in this example, the target side shows a flat schema with a single field that is already mapped:
When you double-click on the response field, you can see that scripting logic has been added using fields from the Salesforce response along with several Jitterbit functions. The logic dictates that if the Salesforce success response (
false, then the Salesforce error message (
root$transaction.response$body$upsertResponse$result.errors#.message$) will be written to the operation log. As this is an upsert operation requiring an external ID to match records for the upsert, the external ID (
root$transaction.request$body$upsert$Account#.Jitterbit_Account_ID__c$) is also reported back in the log.
If you later change which field is used as the external ID, the script will need to be updated with the new source object reference.
Note that for Salesforce insert and delete operations, which do not use an external ID field to match records, the external ID reference is excluded from the script. For such operations, the mapped script contains this logic, shortened to exclude the ID:
<trans> // This mapping is part of a Salesforce wizard. // Modifying it may cause the wizard to malfunction. If(root$transaction.response$body$createResponse$result.success$ == false, WriteToOperationLog( SumString(root$transaction.response$body$createResponse$result.errors#.message$, ". ", false) ) ) </trans>
You can include headers as success/failure files within a Salesforce upsert or update operation from a database source. You must be using a Private Agent that is version 8.24 or later to do this following the instructions below.
These steps show how to capture the header string from a database source and then write the header string at the beginning of a success or failure file:
|NOTE: Setting the global variable |
Create a script to set
<trans> $jitterbit.sfdc.dbsource.sfheader=true; </trans>
Insert the script at the beginning of the update or upsert operation, as shown here for an upsert operation:
This example shows a completed target intended for use with success records:
Right-click on the operation or click on the dropdown arrow to select the Options menu item:
The Operation Options dialog lets you specify the writing of success and failure records:
|NOTE: If you choose Create New, see Local File Target for instructions on creating new files.|
Click OK and then click the Save icon to save the changes to the operation.
This example shows the writing of success records to the target created above and the setting of the writing of failure records to a different target: