2
Vote

Only owner can revoke access to the owner

description

When we try to revoke all the sharings we receive an error message and whole process is rolled back.

It is suggested that the foreach iteratin in Unshare activity to skip Unsharing the principal the item when it is as same as the record owner.

Trace is as below:

Plugin Trace

[CRM2011WorkflowUtilities: CRM2011WorkflowUtilities.Unshare]
[CRM2011WorkflowUtilities (2.0.0.4): CRM2011WorkflowUtilities.Unshare]
Unsharing process primary entity



Error Message:

Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the CRM2011WorkflowUtilities.Unshare plug-in.
konum: CRM2011WorkflowUtilities.Helpers.Throw(String message, Exception innerException)
konum: CRM2011WorkflowUtilities.Unshare.Execute(CodeActivityContext executionContext)
konum: System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
konum: System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Only owner can revoke access to the owner. CallerId: 29e0b8e3-6391-e211-8704-6eae8b268db9, OwnerId: 5ace42e7-d086-e011-8321-00155d012123Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220957</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Only owner can revoke access to the owner. CallerId: 29e0b8e3-6391-e211-8704-6eae8b268db9, OwnerId: 5ace42e7-d086-e011-8321-00155d012123</Message>
<Timestamp>2014-11-07T21:34:11.48541Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220957</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Only owner can revoke access to the owner. CallerId: 29e0b8e3-6391-e211-8704-6eae8b268db9, OwnerId: 5ace42e7-d086-e011-8321-00155d012123</Message>
<Timestamp>2014-11-07T21:34:11.48541Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>
konum: Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
konum: Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request)
konum: CRM2011WorkflowUtilities.Unshare.UnshareRecord(EntityReference target, EntityReference principal, IOrganizationService service)
konum: CRM2011WorkflowUtilities.Unshare.UnshareWithUserTeam(EntityReference target, EntityReference user, EntityReference team, EntityReference callingUser, IOrganizationService service)
konum: CRM2011WorkflowUtilities.Unshare.Execute(CodeActivityContext executionContext)

comments