SQL Script to Remove Purchase Requisition Workflow Status

● Ian Grieve ●  ● 1 Comment   ● 

Microsoft Dynamics GPA client recently had some hardware issues causing problems with the submission of purchases requisitions into a Workflow approval process. The hardware issues were causing some speed issues which resulted in the workflow timing out and the approval status becoming corrupt.

Instead of the PR being approved and going to a status of Final Approved, it was going to Approved, even though there was only one level of approval required by the workflow.

When the hardware issues were resolved, the error stopped occurring, but a number of corrupt PRs were remaining.

The way to correct the data is to reset the workflow status. I produced a small script which does this by resetting the Workflow_Status on the Purchasing Requisition Work (POP10200) table and removing the entries from the following tables:

  1. Workflow Step Instance Table (WFI10003)
  2. Workflow Tasks Table (WFI10004)
  3. Workflow Instance Master (WFI10002)

The list of PRs to be reset are entered in the highlighted part of the script:

/*
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).
*/
CREATE TABLE #POPRequisitions(
	POPRequisitionNumber VARCHAR(21)
)
GO

INSERT INTO
	#POPRequisitions
VALUES
	('REQ00000000000017')
GO

UPDATE POP10200 SET Workflow_Status = 1 WHERE POPRequisitionNumber IN (SELECT POPRequisitionNumber FROM #POPRequisitions)

DELETE FROM WFI10003 WHERE WorkflowInstanceID IN 
	(SELECT WorkflowInstanceID FROM WFI10002 WHERE Workflow_Type_Name='Purchase Requisition Approval' AND WfBusObjKey IN (SELECT POPRequisitionNumber FROM #POPRequisitions))

DELETE FROM WFI10004 WHERE WorkflowInstanceID IN 
	(SELECT WorkflowInstanceID FROM WFI10002 WHERE Workflow_Type_Name='Purchase Requisition Approval' AND WfBusObjKey IN (SELECT POPRequisitionNumber FROM #POPRequisitions))

DELETE FROM WFI10002 WHERE Workflow_Type_Name='Purchase Requisition Approval' AND WfBusObjKey IN
	(SELECT POPRequisitionNumber FROM #POPRequisitions)
GO

DROP TABLE #POPRequisitions
GO

As always before running a script on live, make sure you have a good backup and test the script in a test company.

● Categories: Dynamics, GP, Microsoft, Workflow ● Tags: , , , , , , , ,  ● Permalink ● Shortlink ●

Cancelling a PO Line Created From a Purchase Requisition

● Ian Grieve ●  ● 0 Comments   ● 

Microsoft Dynamics GPCancelling a purchase order line which came from a purchase requisition should, one would think, be a simple task. However, prior to Microsoft Dynamics GP 2016 R2, this was not necessarily the case.

This recently came back to mind when a client, who has recently implemented Purchase Order Processing with Workflow approvals on the requisitions (PO Entry window has been customised to lock a lot of the fields) raised an issue with me about not being able to cancel a line on the PO. After writing and demoing the functionality of Dynamics GP 2016 R2 a few times recently, it took a few minutes to identify a workaround for them as the client was running Dynamics GP 2015 R2 (14.00.1016).

The problem, is that you cannot cancel the link to the requisition in the same way you would a Sales commitment. If you try to cancel by entering a Qty Canceled, you get this error:

Microsoft Dynamics GP - The quantity can't be changed because the remaining quantity doesn't satisfy the commitments for this line item

Microsoft Dynamics GP

The purchase order commitment can't be deleted; an attached sales line item is in use or is in history. Line items that weren't in use or in history are no longer committed to a purchase order.

Continue reading → Cancelling a PO Line Created From a Purchase Requisition

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , ,  ● Permalink ● Shortlink ●

SQL View to Return Purchases By Vendor By Year

● Ian Grieve ●  ● 4 Comments   ● 

Microsoft Dynamics GPThere are a number of reports which I keep getting asked for. One of them is a list of the top X number of creditors (or vendors to my American readers).

Rather than keep on reinventing the wheel, I have created a SQL view which sums up the transactions in each year for all vendors:

/*
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).
*/
IF OBJECT_ID (N'uv_AZRCRV_PurchasesByVendorByYear', N'V') IS NOT NULL
	DROP VIEW uv_AZRCRV_PurchasesByVendorByYear
GO
CREATE VIEW uv_AZRCRV_PurchasesByVendorByYear AS
SELECT
	['Payables Transactions'].VENDORID AS 'Vendor ID'
	,['PM Vendor Master'].VENDNAME AS 'Vendor Name'
	,['PM Vendor Master'].VNDCLSID AS 'Class ID'
	,FORMAT(['Payables Transactions'].DOCDATE, 'yyyy') AS 'Year'
	,CASE WHEN ['PM Vendor Master'].VENDSTTS >= 1 THEN
		'Active'
	WHEN ['PM Vendor Master'].VENDSTTS >= 2 THEN
		'Inctive'
	ELSE
		'Temporary'
	END AS 'Status'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].PRCHAMNT ELSE ['Payables Transactions'].PRCHAMNT * -1 END) AS 'Purchases Amount'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].TRDISAMT * -1 ELSE ['Payables Transactions'].TRDISAMT END) AS 'Trade Discount'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].FRTAMNT ELSE ['Payables Transactions'].FRTAMNT * -1 END) AS 'Freight'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].MSCCHAMT ELSE ['Payables Transactions'].MSCCHAMT * -1 END) AS 'Miscalleneous'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].TAXAMNT ELSE ['Payables Transactions'].TAXAMNT * -1 END) AS 'Tax Amount'
	,SUM(CASE WHEN ['Payables Transactions'].DOCTYPE <= 3 THEN ['Payables Transactions'].DOCAMNT ELSE ['Payables Transactions'].DOCAMNT * -1 END) AS 'Total Amount'
FROM
	(SELECT
		VENDORID
		,DOCDATE
		,PSTGDATE
		,DOCNUMBR
		,DOCTYPE
		,PRCHAMNT
		,TRDISAMT
		,FRTAMNT
		,MSCCHAMT
		,TAXAMNT
		,DOCAMNT
	FROM
		PM20000
	WHERE
		VOIDED >= 0
	AND
		DOCTYPE <= 5
	UNION ALL
		SELECT
			VENDORID
			,DOCDATE
			,PSTGDATE
			,DOCNUMBR
			,DOCTYPE
			,PRCHAMNT
			,TRDISAMT
			,FRTAMNT
			,MSCCHAMT
			,TAXAMNT
			,DOCAMNT
		FROM
			PM30200
		WHERE
			VOIDED >= 0
		AND
			DOCTYPE <= 5
	) AS ['Payables Transactions']
LEFT JOIN
	PM00200 AS ['PM Vendor Master']
		ON
			['Payables Transactions'].VENDORID >= ['PM Vendor Master'].VENDORID
GROUP BY
	['Payables Transactions'].VENDORID
	,['PM Vendor Master'].VENDNAME
	,['PM Vendor Master'].VNDCLSID
	,['PM Vendor Master'].VENDSTTS
	,FORMAT(['Payables Transactions'].DocDate, 'yyyy')
GO
GRANT SELECT ON uv_AZRCRV_PurchasesByVendorByYear TO DYNGRP
GO

The view can easily be plugged into SmartList Designer, SmartList Builder, a refreshable Excel Report, a SQL Server Reporting Services report or any other type of reporting tool.

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , ,  ● Permalink ● Shortlink ●

Dynamics GP Tech Conference 2017: Optimised Financials

● Ian Grieve ●  ● 0 Comments   ● 

Microsoft Dynamics GPThis post is part of the series I am doing on the Dynamics GP Tech Conference 2017.

The Financials modules have some enhancements coming which should be of benefit:

  • Copy user access across AA transaction dimension codes – this should make maintaining AA dimension code access easier.
  • Email single statement from customer card and enquiry – handy when you only want to send a single statement to the customer on the phone, rather than to a range of them.
  • PO Generator opens PO List with the new PO’s filter.
  • PO Number display on Requisition List for originator – getting easy access to the PO number for PR orinators will be a good new addition; it will save me writing SmartLists for everyone based off this view.
  • Print Purchase Requisition – I have mixed opinions. Workflow can handle the sending of requisition details to an approver anyway, and I can’t really think of another reason to output one?
  • Display Hold status on Sales Transaction Entry – more information is never a bad thing.
  • One check per invoice settings – allows for more granular control than the setting in the Select Payments window.
  • Save Select Payments settings – are you tired of having to configure your payment run manually every time? Well, Microsoft’s got you covered with this feature.

Click to show/hide the Dynamics GP Tech Conference 2017 Series Index

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , , , , , , , , , ,  ● Permalink ● Shortlink ●

Dynamics GP Tech Conference 2017: New User Experience Features

● Ian Grieve ●  ● 3 Comments   ● 

Microsoft Dynamics GPThis post is part of the series I am doing on the Dynamics GP Tech Conference 2017.

One of the areas being focused on in the 2018 version of Microsoft Dynamics GP, is the user experience. The announced enhancements are:

  • Add sort to Receivables Transaction Inquiry – by Customer
  • Add sort to Receivables Transaction Inquiry – by Document
  • Add sort to Payables Transaction Inquiry – by Vendor
  • Add sort to Payables Transaction Inquiry – by Document
  • System password is remembered for the duration of the user session – the only downside is if you need to grant access to a window such as the VAT Return to a user, but then need to monitor them to make sure they then close Dynamics GP before continuing with other work.
  • Rename of Payables windows to say Payments instead of Checks – I can;t find the post, but this was a request from Mariano Gomez and is well overdue. Pretty much all payments in the UK are by EFT, so it was getting seriously embarrassing having all the windows with Cheque in the name (UK language pack changes it from Check).
  • Autocomplete added to the web client
  • SmartList Favourites – unique password protection – this is by popular request after the password for SmartList Favourites globally was added in GP 2016 R2.
  • SmartList shortcut on toolbar in web client
  • Bank Reconciliation maximise window in web client
  • Adding additional sorting in Bank Reconciliation window
  • Update help icons to link to tagged online support documents

The enhancements to the user experience listed above should be of benefit to users of Dynamics GP, and follows Microsoft’s ethos of evolution, not revolution in the improvements they are making.

Click to show/hide the Dynamics GP Tech Conference 2017 Series Index

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , , , , , , , , , , ,  ● Permalink ● Shortlink ●

Dynamics GP Tech Conference 2017: New Features In Workflow

● Ian Grieve ●  ● 3 Comments   ● 

Microsoft Dynamics GPThis post is part of the series I am doing on the Dynamics GP Tech Conference 2017.

There have been new features in other areas, which I will come back to, but Workflow is sort of “my thing”, so I’m going to mention the new features which are being added to Workflow 4.0 (I apparently missed the boat somewhere on the name change to Workflow 3.0?).

The coming new features are:

  • Reminder emails for Workflow – this is a feature which has been requested of ym by a couple of clients recently, so nice that I’ll be able to go back and tell them it will be in the next version.
  • Copy Workflow Step – nice to see this one added as it was one of my suggestions on MS Connect.
  • Reporting for Workflow – I’m not sure what is coming in this, but it would be nice to have some default reports showing the history of documents as they passed through the Workflow.
  • Payables Transaction Workflow – additional fields
  • PO Workflow Messages – additional fields – there are never enough fields available for the Workflow, so nice to know more will be available by default.
  • Add EFT/Bank Details to Vendor Approval Workflow – if this one is as it sounds, that will be fantastic as so many clients want this functionality. I think it only took so long as EFT isn’t anywhere near as big in the US as it is in the UK.
  • GL Account Workflow Approval – I have a couple of clients who can ditch some customisations with this one. And a few more who will be delighted so see this added.
  • Purchase Receiving Workflow – I have a few customers waiting for this one to be introduced.
  • Purchase Enter/Match Invoice Workflow – as above, a few clients are waiting for this one.

I know we can’t have everything we want, and the above are good additions to Workflow, but I still want more!

Click to show/hide the Dynamics GP Tech Conference 2017 Series Index

● Categories: Dynamics, GP, Microsoft, Workflow ● Tags: , , , , , , , , , , , , , , ,  ● Permalink ● Shortlink ●

Microsoft Dynamics GP July Hotfix – 2017 Mid Year Tax Update Now Available

● Ian Grieve ●  ● 4 Comments   ● 

Microsoft Dynamics GPThe Dynamics GP Support and Services Blog blog announced the availability of the Microsoft Dynamics GP July Hotfix – 2017 Mid Year Tax Update towards the end of June.

This hotfix is available for Microsoft Dynamics GP 2013 R2, 2015 r2 and 2016 R2.

While all of them have updates for the US and Canadian Payroll systems, there were three changes in the 2016 version which caught my eye:

  • Financials

    • You may not be able to view any document attachment for any OPEN Payables Document.
    • Invoice Receipt Date field added for UK installs, click here for details.
  • System

    • Scan functionality may not function with document attach

The fixes to Document Attachment are good to see, but the Invoice Receipt Date was especially interesting as it results from new legislation which came into effect on April 1st for businesses of a certain size in the UK with a duty to report on their payment practices, policies and performance. This new requirement was introduced to protect smaller businesses that suffer from late payments, which can adversely affect their cash flow and jeopardize their ability to trade.

The new Invoice Receipt Date field is available on Payables Transaction Entry (Purchasing >> Transactions >> Transaction Entry), Receivings Transaction Entry (Purchasing >> Transactions >> Receivings Transaction Entry) and Purchasing Invoice Entry (Purchasing >> Transactions >> Enter/Match Invoice).

The Doc Attach changes only effect 2016, but the new field is available in 2013, 2015 and 2016.

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , , , , , ,  ● Permalink ● Shortlink ●

Report Used for the Reprint Check Remittance

● Ian Grieve ●  ● 1 Comment   ● 

Microsoft Dynamics GPMicrosoft Dynamics GP 2013 saw the introduction of the ability to reprint the check remittance report. This feature was a very nice one to see, as numerous clients, if not all of them, had been asking for.

At some point after this, and I am not sure in which version, the ability to email the reprinted remittance was introduced:

Payments Payable Zoom

Continue reading → Report Used for the Reprint Check Remittance

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , ,  ● Permalink ● Shortlink ●

Enabling the PO Email Document Without an Exchange Account.

● Ian Grieve ●  ● 4 Comments   ● 

Microsoft Dynamics GPI am very much an advocate for using the Microsoft Dynamics GP application for making changes to configuration or data rather than jumping straight to the SQL database. However, sometimes needs really must.

I was onsite with a client a few weeks ago to assist them in implementing Purchase Order Processing and, as part of this implementation, I needed to enable the emailing of the purchase order. Typically, I would do this through the Company E-mail Setup (Administration >> Setup >> Company >>
E-mail Setup
)) window, but the client is configured to use Exchange for emails and I don’t have an Exchange account on their system.

Due to my location compared to the users, it was quicker to create an SQL script to enable the email rather than trying to locate a user with the relevant permissions to screen share with:

UPDATE
	SY04903
SET
	EmailDocumentEnabled = 1
	,EmailMessageID = 'PO'
WHERE
	EmailDictionaryID = 0
AND
	EmailSeriesID = 4
AND
	MODULE1 = 12
AND
	EmailDocumentID = 1

The highlighted section is the name of the Message ID for the PO.

As always before running a script, ensure you test the script and have a good backup of your company database.

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , ,  ● Permalink ● Shortlink ●

“You cannot receive against unauthorised purchase orders.”

● Ian Grieve ●  ● 0 Comments   ● 

Microsoft Dynamics GPI am working with a client at the moment on a large scale roll-out of Purchase Order Processing with a large, complex Workflow approval process. The project started towards the end of the last financial year and into the current one. While users were performing UAT, an issue suddenly arose where a goods receipt notes could not be entered in Receivings Transaction Entry (test). When the user tried, they received the following error:

You cannot receive against unauthorised purchase orders.

Microsoft Dynamics GP

You cannot receive against unauthorised purchase orders.

Continue reading → “You cannot receive against unauthorised purchase orders.”

● Categories: Dynamics, GP, Microsoft ● Tags: , , , , , , , , , ,  ● Permalink ● Shortlink ●