title: Change BPF Stage with Workflow Dynamics CRM 2016
body: <p>We are currently on Dynamics 2016 on premise.  We are following <a href="https://dynamics365blocks.wordpress.com/2018/01/14/how-to-change-bpf-stages-automatically-using-workflow-in-dynamics-365/" rel="nofollow noreferrer">this</a> 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 <a href="https://stackoverflow.com/questions/51430303/changing-business-process-flow-stage-in-c-sharp-plugin">here</a>) and using a trigger to set the database values (yes, we know this is not supported).</p>
  
  <h2>Error</h2>
  
  <pre><code>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: 
  &lt;OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"&gt;
    &lt;ActivityId&gt;bb2e54fb-674a-45b1-a715-3a61722ee875&lt;/ActivityId&gt;
    &lt;ErrorCode&gt;-2147220970&lt;/ErrorCode&gt;
    &lt;ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /&gt;
    &lt;Message&gt;An unexpected error occurred.&lt;/Message&gt;
    &lt;Timestamp&gt;2018-09-27T21:02:20.3406538Z&lt;/Timestamp&gt;
    &lt;ExceptionRetriable&gt;false&lt;/ExceptionRetriable&gt;
    &lt;ExceptionSource i:nil="true" /&gt;
    &lt;InnerFault&gt;
      &lt;ActivityId&gt;bb2e54fb-674a-45b1-a715-3a61722ee875&lt;/ActivityId&gt;
      &lt;ErrorCode&gt;-2147220970&lt;/ErrorCode&gt;
      &lt;ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /&gt;
      &lt;Message&gt;System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #66095F59&lt;/Message&gt;
      &lt;Timestamp&gt;2018-09-27T21:02:20.3406538Z&lt;/Timestamp&gt;
      &lt;ExceptionRetriable&gt;false&lt;/ExceptionRetriable&gt;
      &lt;ExceptionSource i:nil="true" /&gt;
      &lt;InnerFault i:nil="true" /&gt;
      &lt;OriginalException i:nil="true" /&gt;
      &lt;TraceText i:nil="true" /&gt;
    &lt;/InnerFault&gt;
    &lt;OriginalException i:nil="true" /&gt;
    &lt;TraceText&gt;[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
  [UpdateStep3]
  &lt;/TraceText&gt;
  &lt;/OrganizationServiceFault&gt;
     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)
  </code></pre>
  
  <h2>Workflow Setup</h2>
  
  <p><a href="https://i.stack.imgur.com/bkEvX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkEvX.png" alt="Workflow Setup"></a></p>
  
  <h2>Update Contract Setup Step</h2>
  
  <p><a href="https://i.stack.imgur.com/rUJv9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rUJv9.png" alt="Update Contract Setup Step"></a></p>