Error when trying to share Account from Service Activity

Apr 1, 2013 at 10:30 PM
Edited Apr 2, 2013 at 2:36 PM
I am trying to share accounts with a group whenever a service activity is created. The account the service activity references will be shared until the SA has been completed then unshared once it is closed. I cannot seem to get the account sharing to work. If I share the primary entity "the service activity" it works fine. I am unsure of what to use as the attribute name to access my related entity.
Apr 2, 2013 at 1:52 PM
Edited Apr 2, 2013 at 2:38 PM
I have also tried using account, accountid, customers, regarding, as the attribute name, all which result a similar error error. Does anyone know what I should be using as the attribute name to share the account from a service activity??

Plugin Trace:

[CRM2011WorkflowUtilities: CRM2011WorkflowUtilities.Share]
[CRM2011WorkflowUtilities (2.0.2.0): Share]
Retrieving process primary entity


Error Message:

Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the CRM2011WorkflowUtilities.Share plug-in.
at CRM2011WorkflowUtilities.Helpers.Throw(String message, Exception innerException)
at CRM2011WorkflowUtilities.Share.Execute(CodeActivityContext executionContext)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at 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]]: 'ServiceAppointment' entity doesn't contain attribute with Name = 'accountid'.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147217149</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>'ServiceAppointment' entity doesn't contain attribute with Name = 'accountid'.</Message>
<Timestamp>2013-04-01T23:40:01.222441Z</Timestamp>
<InnerFault>
<ErrorCode>-2147217149</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>'ServiceAppointment' entity doesn't contain attribute with Name = 'accountid'.</Message>
<Timestamp>2013-04-01T23:40:01.222441Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Retrieve(String entityName, Guid id, ColumnSet columnSet, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
at Microsoft.Crm.Extensibility.InprocessServiceProxy.RetrieveCore(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at CRM2011WorkflowUtilities.Share.Execute(CodeActivityContext executionContext)
Apr 2, 2013 at 2:47 PM
I solved my issue. regardingobjectid would link the Account to the Service Activity. One day I will get it all together.