dotConnect for Salesforce Documentation
In This Topic
    CachedID
    In This Topic

    The following example illustrates the CachedID approach towards migration of two related tables from SQL Server to Salesforce objects.

    We want to migrate the related Orders and OrderDetails tables to the Opportunity and OpportunityLineItem tables correspondingly:

    To migrate them, we do the following:

    1. Create 2 Data Flow Tasks and bind them with a precedence constraint:
      • the 1st Data Flow Task for data migration from the parent table;
      • the 2nd Data Flow Task for data migration from the child table;
      • within each task we create 2 data flow objects - an OLE DB Source and a Devart Salesforce Destination - and bind them with a data flow path.
    2. Create 2 connections:
      • the 1st one for OLE DB Source data flow components;
      • the 2nd one for Devart Salesforce Destination data flow components.
    3. In the Devart Salesforce Destination data flow object of the 1st Data Flow Task we switch to the Component Properties tab and set the following options:

      • set the Salesforce Object property value to Opportunity;
      • set the CacheID property value to True.
      • set the SourceKey property value to the name of the unique column in the local data source, with which the Salesforce ID will be associated, in our example we set this property value to OrderID.
      • set the Action property value to Insert.
    4. In the Devart Salesforce Destination data flow object of the 2nd Data Flow Task we switch to the Component Properties tab and set the following options:

      • Set the Salesforce Object property value to OpportunityLineItem.
        Note that caching is not required.
      • Set the Action property value to Insert.
    5. After this, we switch to the Column Mappings tab and set mapping as required:

    6. Then we switch to the Input and Output Properties tab and in the External Columns node select the Salesforce column that is a lookup (OpportunityID).

      • in the Properties column, the ReferencedObject custom property value is set automatically and specifies the required referenced object;
      • we set the RelationshipUpdateMode property value to CachedID to define values to be inserted into this lookup column;
      • for the CachedID custom property we set the required Cached ID, which consists of the object name and the column name in the local data source, and in our case is Opportunity_OrderID.

    This is how you can implement data migration to the Salesforce database using the CachedID approach.

    See Also

    Loading Related Data  |  Loading Related Data via ExternalID