Merging records
In Apex, you can combine a maximum of three records and retrieve one record that you want to keep with the information of all the three records. This is a very useful functionality when you want to deduplicate data and merge all of the related children into one parent record.
For example, a company might have a database with its accounts and linked contacts and opportunities. When the Salesforce administrator verifies duplicates in the accounts, he finds three accounts with more or less the same name. The sales manager of that company says, "Yes, it's the same account, but I want to keep one account (this is the most complete account) and the related contacts and opportunities of the three accounts." That works for the powerful ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access