1

We are currently on Dynamics 2016 on premise. We are following this article to set up a workflow to change the Stage on one of our business process flows. The setup of our BPF is below. We are receiving the following error when the BPF runs. I've narrowed this error down to somewhere in the Update Contract Setup Stage step. What are we missing here? Perhaps we are trying to do something only available on D365? Other attempts at changing the stage on a BPF include using the Web API (issues detailed here) and using a trigger to set the database values (yes, we know this is not supported).

Error

Plugin Trace:

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
[UpdateStep3]



Error Message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ActivityId>bb2e54fb-674a-45b1-a715-3a61722ee875</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>An unexpected error occurred.</Message>
  <Timestamp>2018-09-27T21:02:20.3406538Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>bb2e54fb-674a-45b1-a715-3a61722ee875</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #66095F59</Message>
    <Timestamp>2018-09-27T21:02:20.3406538Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
[UpdateStep3]
</TraceText>
</OrganizationServiceFault>
   at Microsoft.Crm.Workflow.Services.UpdateActivityService.Execute(ActivityContext executionContext, UpdateEntity updateEntity)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Workflow Setup

Workflow Setup

Update Contract Setup Step

Update Contract Setup Step

Tim Hutchison
  • 3,483
  • 9
  • 40
  • 76
  • How about trying to put static values in your update Contract Setup Step first. Also Is it allowed to move from your current BPF Stage to the Stage mentioned in Update Contract Setup Step. I would try small steps such as manual (static fields) with just the next stage from the current running one. – AnkUser Oct 01 '18 at 05:34

1 Answers1

0

I'm not sure if you can do this directly, but i used in the past Dynamics Workflow Tools which have a lot of functions which you can call from a workflow. For BPF Stage you can use "Set Process Stage" Method.

SGeis
  • 291
  • 1
  • 7