function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Salesforce to salesforce three level deep migration



I have transferred two level deep records from one organisation to another through salesforce to salesforce.

For e.g Account and its related contacts.

But how can we transfer three level deep records at one go i.e Account -> Contact -> A child object of Contact.


I'm using this method

for(Account acc:ls)
                    //object declaration for PartnerNetwork
                    PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
                    system.debug('Second for loop');
                    newrecord.ConnectionId = network.Id;
                    newrecord.LocalRecordId =;  
                    newrecord.RelatedRecords = 'Contact,Opportunity';
                    newrecord.SendClosedTasks = true;
                    newrecord.SendOpenTasks = true;
                    newrecord.SendEmails = true;
                    //All the Records are added to the PartnerNetwork

 In this way I'm transferring Account, related Contacts and opportunities. But how can we transfer any child records of contact or opportunity at one go?


If anyone knows about this kindly help me out.


Thanks in advance