QUESTION:
During a merge, is there a way to take the owner of the Non-Master Record and add them to the Account Team of the Master Record?
ANSWER:
There is no way to do this as part of the merge process.
However, a file called “NonMasterOwnerChange_currentdate” is created after a Single Table Dedupe process to capture the owner ID’s for any non-master records where the owner was not the same as the master record owner. This file is appended to throughout the course of a particular day, so ALL merges for that day are tracked in this one file.
Although this solution refers to adding Account Team Members, the "NonMasterOwnerChange..." file can be used to insert into any Team Member or Share table in Salesforce and/or any other custom field/related table on the master record (e.g. Lead Share, Opportunity Team Member, secondary owner field, etc.).
The file will differentiate the type of Object merged in the "Object" column. If different types of objects were merged in a particular day the file will need to be sorted by Object and broken into separate files by Object prior to performing the imports via MassEffect.
The file is saved in the DemandToolsData\LogFiles folder (the same place where the Log Files are saved).
Here is an explanation of the columns in this file:
- DateTime - Date/Time the record was merged
- Object - The type of the object merged (e.g. Account, Contact, etc.)
- Master ID - The Salesforce ID for the Master Record that was kept during the merge (e.g. the AccountID is the Account to which the Team Members will be added)
- MasterOwnerID - The UserID of the user who owns the Master Record (for informational purposes only)
- MergedOwnerID - The UserID of the user who owned the non-master record (this will be the user that is added to the Account Team)
- isMergedOwnerActive - True/False – provided in case the non-master record owner was an inactive user. Salesforce will not allow an inactive user to be added to an Account Team (these can be filtered out of the file before adding the new Account Team Members)
- MasterRecordCustomField: If you elected to track data from another field in the log file during a merge (using the Extra Field Logging option in screen #3 of Single Table Dedupe) this data is also captured; may help to determine what role you wish to assign to this new Account Team Member
- ServantRecordCustomField: : If you elected to track data from another field in the log file during a merge (using the Extra Field Logging option in screen #3 of Single Table Dedupe) this data is also captured; may help to determine what role you wish to assign to this new Account Team Member
There will be a separate row for each record merged into the master and ONLY where the owners were different. For example, if there were 5 duplicate ABC’s where 3 had the same owner, there would be 2 rows added to this file with the Account ID for the ABC master record.
To use this file to add the Account Team Members:
NOTE: Users need to upgrade to DemandTools 2.7 before inserting the new Team Members as Salesforce CHANGED the sharing tables starting in API 37.0 (which is the API version DemandTools 2.7 is built on). Prior to this change if wanting to insert Team Members with increased sharing levels users needed to do 2 inserts, one to the AccountShare table and another to the AccountTeamMember table. Starting in API 37.0 users ONLY need to insert into the AccountTeamMember table as the Account, Contact, Opportunity, and Case access levels are now fields in the AccountTeamMember table.
- Sort the file by "Object" and then by "isMergedOwnerActive".
- Break all the "Account" object records where the "isMergedOwnerActive" = True into a separate file.
- Open DemandTools and access the MassEffect module
- Select the file created above as the input file
- Select “Insert New Records” as the operation on the right
- Click the + sign to the left of the AccountTeamMember Table to show the fields in this table
- Map: “Master ID” -> “AccountID” and “MergedOwnerID” -> "UserID"
- Specify the Account Team Role by either:
- Right clicking on the “Role” field to use the Add Constant option to select the desired role
- OR, mapping a role from your input file (will need to add the Role to the file manually).
- Specify the desired Account, Contact, Opportunity and Case access levels by either:
- Right clicking on the specific Access field(s) to use the Add Constant option to select the desired access level
- OR, mapping the fields from your input file (will need to add the fields to the file manually).
- Process
More information can be found in the solution: Adding Account Team Members.