Incorrect Microsoft Dynamics GP Purchase Orders Workflow Status

Microsoft Dynamics GPI recently had an error reported to me in Microsoft Dynamics GP where some final approved purchase orders were not working correctly when opened in the Purchase Order Entry window (Purchasing area page » Transactions » Purchase Order Entry).

The PO is shown as not submitted in the workflow status bar, but the button on the tool is a Recall button rather than a Submit one showing that the document has been submitted:

PO Entry window showing workflow status bar and action pane

In addition, if you tried to open the Workflow History window, the following error was produced:

Error message opening Workflow History

The record has been deleted since you opened this window.

I did some exploring and found the issue was corruption on the Purchase Order Work (POP10100) table whereby the Workflow_Status column had the wrong value; it was set to 4 instead of 6. There was a set of about a dozen POs with tiis problem; ones before and after were working correctly so it appears to have been a temporary issue which then can;t be reproduced.

To fix the corrupt items, I created a simple SQL script which would correct the Workflow_Status column:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
UPDATE ['Purchase Order Work'] SET Workflow_Status = ['Workflow Instance Master'].Workflow_Status FROM POP10100 AS ['Purchase Order Work'] INNER JOIN WFI10002 AS ['Workflow Instance Master'] ON ['Workflow Instance Master'].WfBusObjKey = ['Purchase Order Work'].PONUMBER WHERE ['Purchase Order Work'].Workflow_Status = 4 AND ['Workflow Instance Master'].Workflow_Status = 6

As always with SQL scripts which do updates, make sure you test the script and have a good backup

What should we write about next?





Your Name (required) –
Your Email (required) –

Leave a Reply

Your email address will not be published. Required fields are marked *