The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Upserting Contacts to Accounts with an External ID in Data Loader (opens in a new tab)

You will learn how to set up a unique External ID on Account, load Accounts before Contacts, and map the source key to relate them without a post-load VLOOKUP.

Why read this

You will also see which reference fields cannot be mapped to External IDs and what still breaks.

  1. Create unique External ID on Account
  2. Back up and test a small subset
  3. Upsert Accounts
  4. Upsert Contacts, mapping Account:External_ID__c
The order of operations for relating Contacts to Accounts by External ID

Relationships in Salesforce are stored as record IDs, so a source system’s Account key in a Contact file cannot be used as AccountId. The walkthrough follows Salesforce Help: create or reuse a unique External ID field on Account, load Accounts first (insert, or upsert for reruns), then upsert Contacts and map the source-key column to the Account:External_ID__c field.

The steps include backing up and testing with a small subset, and the Data Loader wording is quoted from Salesforce Help rather than a live run. The example data is invented and was not loaded into an org. A Contact whose key is missing from the Accounts will fail, and that failure appears in the error file.

The piece lists the main failure causes: blank or non-unique External IDs, child rows loaded before the parent, and Lookup Filters or Validation Rules. It also notes that Polymorphic Fields and a Custom Object’s Owner cannot be mapped to External IDs, and that a successful upsert does not prove the source key was correct.

Read the original at dev.to (opens in a new tab)

Worth reading?

Must-read

Migrating HubSpot to Salesforce: External IDs, upsert, and load order (opens in a new tab)

Readers will learn how to structure a reliable HubSpot to Salesforce data migration using External IDs, proper load ordering, and Bulk API, including strategies for handling hierarchies, deltas, and validation.

  1. Cleanse data and map picklists
  2. Dry run in sandbox with disabled automations
  3. Load records following dependency order
  4. Enable read only mode and run delta load
  5. Verify record counts and relationship integrity
Phased migration process from HubSpot to Salesforce

The article addresses the complexity of moving historical records and relationships from HubSpot to Salesforce, emphasizing that simple export import fails due to differing data models. It establishes the External ID field as the foundation for tracking records, enabling idempotent upserts, and linking related objects without relying on Salesforce generated identifiers.

It outlines a strict dependency sequence for loading records, starting with Users and Accounts before moving to Contacts, Opportunities, and Activities. Special attention is given to Account hierarchies, recommending a two pass approach to avoid parent child reference errors. The piece includes a Python example using the Bulk API to demonstrate upserting an Opportunity by matching its Account via an External ID rather than a native Salesforce identifier.

Before migration, the author stresses data cleansing, deduplication rules, and mapping picklist values like pipeline stages. A sandbox dry run is recommended to generate repeatable error reports and to temporarily disable automations such as Flow and Apex triggers that could trigger unwanted side effects during bulk loads.

The final phase uses a delta load strategy to capture changes made after the initial bulk transfer, requiring source system read only mode and timestamp tracking. Post migration validation involves comparing record counts, verifying relationship integrity, reconciling financial totals, and spot checking field values to ensure data accuracy before full team adoption.

Read the original at dev.to (opens in a new tab)

Worth reading?