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
Alfredo Ornelas 4Alfredo Ornelas 4 

Opportunity with products sharing with Salesforce to Salesforce

Hi,
I'm new with Apex, can you help me and modify this piece of code to share Opportunity with products instead of Contact record via S2S?
 
Here is basic code snippet to share a contact record via S2S programmatically.

PartnerNetworkRecordConnection newConnection =
                    new PartnerNetworkRecordConnection(
                        ConnectionId = networkId,
                        LocalRecordId = newContact.Id,
                        SendClosedTasks = false,
                        SendOpenTasks = false,
                        SendEmails = false,
                        ParentRecordId = newContact.AccountId);
insert newConnection;

 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Alfredo Ornelas,

May I suggest you please refer the below link for reference.
https://help.salesforce.com/articleView?id=000002680&type=1

Hope it will be helpful.

Best Regards
Rahul Kumar