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
Sai Harshitha BandlamudiSai Harshitha Bandlamudi 

How to reestablish lookup relationship in Target Org in S2S

I have a Object called "Object A" and it has a lookup with "object B" . 
I have forwarded object A into Target Org using the trigger:
trigger SendObjectAToConnection on ObjectA(after insert,after update) {
        PartnerNetworkConnection conn = [select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection  where ConnectionStatus = 'Accepted' and ConnectionName = 'ABC'];
        List<PartnerNetworkRecordConnection> recordConnectionToInsert  = new List<PartnerNetworkRecordConnection>  ();
        
        for (ObjectA acc : Trigger.new){
            PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();

            newrecord.ConnectionId = conn.Id;
            newrecord.LocalRecordId = acc.id;  
            newrecord.SendClosedTasks = false;
            newrecord.SendOpenTasks = false;
            newrecord.SendEmails = false;
            recordConnectionToInsert.add(newrecord);
        }
        if (recordConnectionToInsert.size() > 0){
            System.debug('>>> Sharing ' + recordConnectionToInsert.size() + ' records');
            insert recordConnectionToInsert;
        }
     }
Similar Trigger for Object B. When I publish both objects into the Target Org, I donot know how to recreate their lookup relatuionship.

Similar trigger for 
pconpcon
I have never done Salesforce 2 Salesforce, so a buch of this link [1] goes over my head.  But it seems to be the same thing you are trying to do.  Does this help you at all?

[1] https://developer.salesforce.com/forums/?id=906F00000008xu0IAA