Loading

What Is the MasterRecordId Field and When Is It Populated on Salesforce Records?

Publiseringsdato: May 31, 2026
Beskrivelse

When you perform a query or data export using an API tool such as Salesforce Data Loader or Workbench, a field called MasterRecordId appears in the results for Lead, Account, and Contact objects. This field is not visible in the Salesforce user interface on the object's field list in Setup, but it is accessible via the Salesforce API.
The MasterRecordId field is sometimes populated with a record ID, and sometimes empty. This article explains what this field means and when it is populated.

Løsning

The MasterRecordId field is populated when a record merge is performed on Lead, Account, or Contact records. When two records are merged, the losing record is deleted. The MasterRecordId field on the deleted (losing) record is populated with the Salesforce record ID of the winning (master) record.
Example:
Consider two Account records:

  • Account 1: SFDC Test 1 — Record ID: 0013D00000ZUufQQAT
  • Account 2: SFDC Test 2 — Record ID: 0013D00000ZB5ekQAD

If these two records are merged and SFDC Test 1 is selected as the master record:

  • Account 2 (SFDC Test 2) is deleted.
  • If you export Account records using Data Loader > Export All, the MasterRecordId value for the deleted Account 2 record shows as 0013D00000ZUufQQAT (the ID of the winning record, SFDC Test 1).

When is MasterRecordId empty? The MasterRecordId is empty (null) when the record has never been involved in a merge operation. Most records will have an empty MasterRecordId.

Knowledge-artikkelnummer

000383966

 
Laster
Salesforce Help | Article