SalesForceBulkIU
Class name |
com.ebd.hub.datawizard.iu.SalesForceBulkIU |
This Integration Unit is deprecated.
Important note: To be able to use this Integration Unit, you need the add-on module "Salesforce". If you are interested, please contact our support or sales staff. The installation/configuration (storing file salesforce.jar in ./extlib and creating an entry in file ./etc/database.xml) is done in that context and is assumed as a given in this description. The add-on module uses a JDBC driver (of the company Progress) that directly connects Lobster Integration to Salesforce (so not via the Salesforce SOAP API and REST API). This JDBC API also provides a bulk API, which is used by this Integration Unit.
This Integration Unit is used for inserting (or deleting) bulk data into a Salesforce system. Important note: The SQL execution during phase 4 must be switched off to use this Integration Unit. This is done by the Integration Unit.
Additionally, the Integration Unit provides the ability to work with the Salesforce concept of external IDs (EXT_ID). An example of how to use this concept in Lobster Integration can be found below. For details about this and other Salesforce concepts (such as linked tables), see the Salesforce documentation (and the Progress JDBC driver documentation).
The Integration Unit uses the following SQL-relevant node attributes of the
target
structure
DB Alias. Note: Only fixed values and system constants are evaluated but no variables.
SQL table/procedure.
Truncate table.
SQL mode. You can use "insert", "only update" and "only delete" are possible if at least one field has attribute "SQL key" set. You can also use "try update before insert" if at least one field contains the keyword "EXT_ID" in attribute SQL column name (see example below for the use of external IDs).
Note: Node attributes Opt. Pre-SQL execution and Transaction control are not used.
The Integration Unit uses the following SQL-relevant attributes in
target
structure fields.
SQL column name.
Note: Field attribute SQL AutoGenKey is not used. Field attribute SQL key is ignored if node attribute SQL mode is set to insert or if at least one field contains the keyword EXT_ID in attribute SQL column name (see example below for the use of external IDs).
Parameters
Parameter |
Description |
Debug |
If true, debug information is logged. |
Example
As an example we want to show the case that we get data from an SAP system and insert it into a Salesforce system. We know the unique IDs of the records from the SAP system, but we do not know the IDs of records in the Salesforce system. Salesforce offers the possibility to define external key columns (external IDs), which we will fill with the keys from the external system (SAP). Salesforce uses this mechanism to allow you to uniquely insert records without knowing the internal Salesforce IDs.
Initial situation
Assume we have two tables ACCOUNT and CONTACT in Salesforce. Both tables have the field ACCOUNTID through which they are linked. Table ACCOUNT contains the master records and table CONTACT the child records.
We already have records in both Salesforce tables, but we do not know the ACCOUNTIDs.
Now we get contact records from an SAP system and want to insert them into the Salesforce system. To do so, we use the already mentioned mechanism of external IDs. First, we need to do some preparatory work in Salesforce.
Preparations in Salesforce
In both Salesforce tables ACCOUNT and CONTACT, we need to insert another field that serves as an external ID. We call it SAP_ACCOUNT (1) and SAP_CONTACT (2). How this is done in detail in Salesforce will not be described here, but you will find it in your Salesforce documentation. As a result, we need the following.
Preparations in Lobster Integration
In Lobster Integration, we now create a database node for the Salesforce table "CONTACT". As a result, you will get something like the following.
We are interested in the fields ACCOUNTID (3) and SAP_CONTACT__C (4). The field SAP_CONTACT__C is the API name of the field SAP_CONTACT (2) inserted by us.
The target node attribute SQL mode (5) has to be set to try update before insert. This corresponds to an UPSERT.
Settings for the external ID
Now all we have to do is to add tags for the JDBC driver for the mechanism of the external IDs.
First we mark field ACCOUNTID (6) by adding the suffix EXT_ID SAP_ACCOUNT__C to the value of attribute SQL column name (7).
This tells Salesforce to find the ACCOUNTID by looking in column SAP_ACCOUNT__C (the external ID there) in table ACCOUNT and to use it for the UPSERT.
Note: Specifying a reference object is not necessary in this case, because our two tables in this example are linked. If this were not the case, the column name would have to be extended as follows: <COLUMNNAME> EXT_ID <REFERENCEOBJECT>__R.<FIELDNAME>__C, so ACCOUNTID EXT_ID ACCOUNT__R.SAP_ACCOUNT__C in this case.
Finally, the SQL column name (9) of field SAP_CONTACT__C (8) will only be extended by suffix EXT_ID.
This tells Salesforce to use this column as the primary key for the UPSERT.