BC Idea | Prevent Duplicate External Document No.
This was the second BC Idea I chose to implement, because I have also seen quite a few customers questioning this, especially former NAV customers that at some point had such a feature.
At the time of choosing this BC Idea, user Melissa Reichenbacher had collected 105 votes since its original posting back in 5/22/2020. Let’s take a look at the request:
Add a notification to alert users during order entry if the External Document No. entered on a new Sales Order already exists in an open Sales Order or posted Sales Invoice.
This is important to ensure a single customer order is not accidentally entered more than once. An additional enhancement would be the ability to set a default for the whole system with the ability to disable on a customer card.
If you also navigate through the comments, you will see how many people actually found this useful and added their own details to how they would like to see this working.
Challenges of the original Navision approach
When looking at this request, and remembering how Navision used to implement this, we definitely need to make improvements to this functionality. In the former days of Navision, if an External Document No. already existed for a customer, you simply could not reuse that External Document No. However, there were certain situations where users really needed to reuse that document No., and most of the times it was because they were just issuing the same invoice again (probably due to some error on the first invoice).
What happened then, is that users started to slightly manipulate the External Document No. in order to be able to “reuse” the original number: They added blank spaces to the beginning of the number, or they added dots or other symbols to the end of the number. With this, Navision would not recognized those manipulated numbers as existing, and users would be able to post the “same” External Document Number.
At the same time that users could reutilize numbers in a creative way, it created other challenges, such as trying to report off of that field.
I personally wouldn’t want to implement this the same way, so that we can have some quality over the External Document No…
⏳
Implementation Details and Settings
The way I developed this feature, I created a global setting in the Sales & Receivables Setup with 3 values:
- No: Using the same External Document No. will not be an issue.
- Warning: If the user enters a duplicate Ext. Document No. (based on existing Sales Orders or Posted Sales Invoices), BC will throw a warning message, but it will let the user proceed.
- Error: If the user enters a repeated Ext. Document No. (based on existing Sales Orders or Posted Sales Invoices), BC will throw an error message and the user will not be able to proceed.
The original poster also commented that it would be great if this setting could be done per customer as well, so I went ahead and added the same field on the Customer Card.
Here, you have 4 options: To use the default value from the Sales & Receivables Setup (and you shall see between parenthesis what is the current default value), and the other 3 possible options (No, Warning and Error).
Setting: Warning
When you set BC to give you a warning, if you enter a duplicate Ext. Document Number, you shall see a message like the one below. You will be able to press Ok, and continue to use the same document number:
Setting: Error
When you set BC to throw an Error, then you shall see a message like the one below, and you won’t be able to proceed until you enter a new Ext. Document No.:
Warning: Microsoft Implementation ⚠️
Since this idea has been posted, Microsoft has picked it up to be developed through their pilot open source contribution program, and they are coming up with their own implementation of this. As of now, their implementaiton will follow the Notification System pattern, where a blue notification is thrown at the top of the Sales Order document, which will probably suffice for most users. Since I’ve already developed this, I’m going to leave this implementation available, but you don’t have to enable it if you prefer to use Microsoft’s implementation.
Disclaimer
If you do enable this BC Idea, please use it at your own risk. Truthfully there’s not a lot of risk here but you have to be mindful of any potential conflicts with other existing extensions in your environment. Also, don’t forget to always try these features in a Sandbox environment first, and have users test it before really deploying to Production.
That’s it! 🎉
If you liked this idea, this development, or if you have questions or comments about this, don’t hesitate to react and/or post on the discussion below (you will need a GitHub account).