Dynamics GP Payables - A unique document number could not be found Please check setup

Payment run failed after GP upgrade

On upgrading to GP: Version 18.4.1361 (2021) everything worked great except for making EFT payments.

On printing the EFT payments, the following error popped up.

A unique document number could not be found. Please check setup.

A Unique Document Number Could Not Be Found. Please check setup.

Although it could be clicked through the first time, attempting further subsequent EFT payments resulted in another message box.

An error occurred. Contact your system administrator to verify data.

An Error Occurred. Contact your system administrator to verify data.

This was annoying as this prevented any further EFT payments, although manual payments were absolutely fine.

Diagnosing the problem

I posted the issue on the community forum and lodged a ticked with our support partner, just in case this couldn’t be resolved ourselves… then time to dig in and investigate as not paying suppliers is a big issue…

This was a familiar message to me from other modules of GP, where the number sequence has gone so far out of range that GP fails to scan for a new number, or the number sequence has not been defined – this experience helped me later narrow in on the problem. I checked the purchasing setup window and the various GP tables to find that the next numbers for both that chequebook and the payables transactions. All were all looking correct.

hmmm…

It felt like something was wrong when GP was getting the next chequebook number (or perhaps payment transaction number, though it felt less likely), you get a gut feeling on these things when working with a product long enough!

Next action was to capture a SQL debug trace and a Dexterity Script debug trace around that operation. The SQL trace had nothing interesting in it. However the script trace did. This showed the error box was being called after function “GenerateNextEFTNumber” was executed.

'GenerateNextEFTNumber of form PM_Print_Computer_Checks', table 'CM_Checkbook_MSTR', "0000000000000001012343295", 0

'PM_Number_Inc_Dec', "", 1

'SaveCurrentFormTrigger', 2567, 0, "SY_Error_Message"

EFT Number, what is that?? – I’m not that familiar with the EFT module in GP, so I went looking around the configuration for EFT, which hangs off the chequebook form.

I found in the EFT options here: Cards->Financial->Chequebook->EFT Bank->Payables Options

EFT Setup - Payable Optoins shiowing use cheque numbers and empty field for next number

In there it states option is to use the cheque number, but it looks like it is possible rather than use up cheque numbers, to use a unique EFT sequence number for EFT payments. This was the moment that I felt that I knew what was happening.  You may see from the screen shot that there is no EFT number in the Next EFT Payment Number field. On the test environment I seeded this value with EFT000000000001, having also set the option to “Use EFT Numbers”. This time the payment processed as expected and the “Next EFT Payment Number” incremented by the number of payments.

Aha! – I set the option back to “Use Cheque Numbers” but leaving the Next EFT Payment Number populated and it still allowed payments to be processed. It looks like the blank field was the problem.

Fix Production environment

I moved to production environment and ran

UPDATE CM00101 SET EFTPMNextNumber = 'EFT000000000001'

that will seed the Next EFT Payment Number for all the chequebooks (make sure this is ok in your environment and do for each company DB).

The setup options for EFT now looked like this below, with a value in the next number field but option still to use cheque numbers…

EFT Options with corrected setup

On attempting to do the payments run, it worked just as it did pre-upgrade. –yay!

Conclusion

Conclusion is that even if the option is set to “Use Cheque Numbers”, then GP will still attempt to generate EFT numbers, and thus needs the field for Next EFT Payment Number to be populated. It is not so much “used” but is “required”.

Also out of curiosity went and created a new chequebook. On opening the EFT options window of this new chequebook, the “Next EFT Payment Number” field is pre-populated by the application with “EFT000000000001” – thus on a current versions of GP this issue would not happen. There would always be a value in that field. I guess in the past versions of GP that this field was not auto populated by the application, thus our chequebooks ended up with blank fields, that only then became an issue after upgrading to this latest version of GP.

It was a stressful few hours but outcome was good.