July 4, 2021

INVALID_PARTNER_NETWORK_STATUS, invalid status for partner network operation: []

"INVALID_PARTNER_NETWORK_STATUS, invalid status for partner network operation: []" exception occur if the "LocalRecordId" attribute of "PartnerNetworkRecordConnection" is incorrect.
 
Sample Code:
PartnerNetworkConnection network = [ SELECT Id FROM PartnerNetworkConnection WHERE ConnectionStatus = 'Accepted' LIMIT 1 ];
List < PartnerNetworkRecordConnection > listConnections = new List < PartnerNetworkRecordConnection >();
PartnerNetworkRecordConnection connection = new PartnerNetworkRecordConnection();
connection.ConnectionId = network.Id;
connection.LocalRecordId = '0015Y00002dfRIF';//Id of the record to be shared to the other Salesforce Org
listConnections.add( connection );
insert listConnections;

No comments:

Post a Comment