I 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 ( ).
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:
In addition, if you tried to open the Workflow History window, the following error was produced:
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 this 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 an IT Professional (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?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.
Hello, Thanks for the information you posted. We are having this issue pretty regularly. Did you every find out what is the root cause of the issue?
Thanks!
Manny
Hi Manny,
No, we’ve not been able to reproduce the error and I’ve not heard it being reported since.
Ian