You need to sign in to do that
Don't have an account?
Exception in deleting record from PartnerNetworkRecordConnection object
We have code to share/unshare account with other Org using Salesforce to Salesforce connection. Code ws running fine but now when I unshare the account it throughs below error-
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger shareAccountWithSalesforceToSalesforce caused an unexpected exception, contact your administrator: shareAccountWithSalesforceToSalesforce: execution of AfterUpdate caused by: System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []: Class.SalesforceToSalesforce.unshareRecords: line 32, column 3".
when I debugg the issue then found that deletion is not allowed in PartnerNetworkRecordConnection object and below exception occured-
System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []
Can somebody help me how can I unshare the account?
The error was due to recurssive call of trigger. I used the static variable to avoid the error.
All Answers
Is the method described here inaccurate?
www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_partnernetworkrecordconnection.htm
It sounds like you have a trigger causing issues. It's trying to delete a record after update, which you can't do.
The error was due to recurssive call of trigger. I used the static variable to avoid the error.