No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
PartnerNetworkRecordConnection
Represents a record shared between Salesforce organizations using Salesforce to Salesforce.
Supported Calls
create(), delete(), query(), retrieve()
Fields
| Field | Details |
|---|---|
| ConnectionId |
|
| EndDate |
|
| LocalRecordId |
|
| ParentRecordId |
|
| PartnerRecordId |
|
| RelatedRecords |
|
| SendClosedTasks |
|
| SendEmails |
|
| SendOpenTasks |
|
| StartDate |
|
| Status |
|
Usage
When you create a PartnerNetworkRecordConnection, you forward a record to a connection.
When you delete a PartnerNetworkRecordConnection, you stop sharing a record with a connection.
- To share a record, use the following fields: LocalRecordID and ConnectionId
- To share a child of a parent record, use the following fields: LocalRecordID, ConnectionId, and ParentRecordID
- To share a child of a parent record and its child records, use the following fields: LocalRecordID, ConnectionId, ParentRecordID, and RelatedRecords
If the organization does not have Salesforce to Salesforce enabled, the PartnerNetworkRecordConnection object is not available, and you can’t access it using the API.
Sample Code—Apex
The following example shows how to forward a record.
1List<PartnerNetworkConnection)> connMap = new List<PartnerNetworkConnection>(
2 [select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection
3 where ConnectionStatus = 'Accepted']
4);
5for(PartnerNetworkConnection network : connMap) {
6 PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
7
8 newrecord.ConnectionId = network.Id;
9 newrecord.LocalRecordId = accountId;
10 newrecord.RelatedRecords = 'Contact,Opportunity,Orders__c';
11 newrecord.SendClosedTasks = true;
12 newrecord.SendOpenTasks = true;
13 newrecord.SendEmails = true;
14
15 insert newrecord;
16}The following example shows how to stop sharing a record.
1List<PartnerNetworkRecordConnection> recordConns = new List<PartnerNetworkRecordConnection>(
2 [select Id, Status, ConnectionId, LocalRecordId from PartnerNetworkRecordConnection
3 where LocalRecordId in :accounts]
4);
5
6 for(PartnerNetworkRecordConnection recordConn : recordConns) {
7 if(recordConn.Status.equalsignorecase('Sent')){ //account is connected - outbound
8 delete nets;
9 }
10 }