사용자가 주문을 더 이상 따르지 않는 경우 주문의 후속 조치를 제거해야하는 주문 양식의 사용자 지정 워크 플로가 있습니다. 사용자 지정 워크 플로는 On-Demand로 실행하도록 설정했지만 Dynamics CRM 2016에서 주문형 옵션의 선택을 취소하면 작동하지 않습니다.Dynamics CRM에서 사용자 지정 워크 플로가 실행되지 않습니다. 2016
다음은 내 코드 조각 및 추적 서비스를 통해받은 세부 정보입니다 . 아무도 이것에 안내 할 수 있습니까?
코드 조각
Guid orderId = this.inputEntity.Get(caContext).Id;
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
" <entity name='postfollow'>" +
" <attribute name='regardingobjectid' />" +
" <attribute name='ownerid' />" +
" <filter type='and'>" +
" <condition attribute='regardingobjectid' operator='eq' uitype='salesorder' value='"+ orderId + "' />" +
" </filter>" +
" </entity>" +
"</fetch>";
var followQuery = new FetchExpression(fetchXml);
EntityCollection followCollection = service.RetrieveMultiple(followQuery);
temp = followCollection.Entities.Count;
if (temp < 1)
{
return;
}
ownerIds = new string[temp];
foreach (Entity follow in followCollection.Entities)
{
ownerIds[i] = (((EntityReference)follow.Attributes["ownerid"]).Id).ToString();
i++;
}
List<string> allUsersList = allUsers(service, orderId);
string[] allusersArray = allUsersList.Distinct().ToArray();
do
{
if (allusersArray.Contains(ownerIds[j].ToLower()))
{
}
else
{
removeFollowShip(caContext, service, new Guid(ownerIds[j]), orderId);
}
j++;
} while (j < ownerIds.Length - 1);
추적 서비스 내용 플러그인 추적이
:
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.RetrieveEntity]
[RetrieveEntity]
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Entity Reference cannot have Id and Key Attributes empty.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Entity Reference cannot have Id and Key Attributes empty.</Message>
<Timestamp>2017-04-11T16:17:32.745259Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.ArgumentException: Entity Reference cannot have Id and Key Attributes empty.</Message>
<Timestamp>2017-04-11T16:17:32.745259Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.RetrieveEntity]
[RetrieveEntity]
</TraceText>
</OrganizationServiceFault>
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Retrieve(EntityReference entityReference, ColumnSet columnSet, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode)
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 Microsoft.Crm.Workflow.Services.RetrieveActivityService.<>c__DisplayClass1.<RetrieveInternal>b__0(IOrganizationService sdkService)
at Microsoft.Crm.Workflow.Services.ActivityServiceBase.ExecuteInTransactedContext(ActivityDelegate activityDelegate)
at Microsoft.Crm.Workflow.Services.RetrieveActivityService.ExecuteInternal(ActivityContext executionContext, RetrieveEntity retrieveEntity)
at Microsoft.Crm.Workflow.Services.RetrieveActivityService.Execute(ActivityContext executionContext, RetrieveEntity retrieveEntity)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
더 나은 방법을 설명하지 않은 채 투표를하는 것은 도움이되지 않습니다. –