
D365 Business Central Configuration Package Challenges – Sales Orders Error
I recently had a D365 Business Central client that whenever she attempted to ship and invoice specific sales orders, she would receive an error message “The record in table Sales Invoice Header already exists" - see screenshot below.
She was able to ship and invoice other sales orders without issue. However, certain sales orders would error out, regardless of what she did. Since this error was concerning the posted invoice number, we first investigated the numbering series for posted sales invoices. Here is what we found:
- The invoice number in our error message was not from the currently assigned numbering series
- The invoice number in our error message was from a previous numbering series
- The previous numbering series was one that had been replaced by the current numbering series.
Great information, but what next? After reading a few user questions in the Dynamics 365 User Group site, I found comments referencing the sales header table and specifically the Shipping Number and Posting Number fields. I tried accessing these through the user interface but was unable to. This is when I turned to my trusty friend: the configuration package! Not only does this tool help with integrating master records, but it also helps us access fields that are inaccessible through the front end.
Once I opened the configuration package I realized that the table that I needed (Sales Order Header) was not in the standard package. Hmmm… I didn’t give up that easily though! I went to the end of the list (it's BIG) and was able to add the table number for the Sales Order Header. Once I tabbed through all of the fields, it stated that related tables needed to be checked, did I want to check for them now? I selected yes… fingers crossed!
Success! Below is the list of related tables. I closed the window as my work would not affect any related tables.
Once I added the sales invoice header table, I (1) went to the table menu, (2) selected Excel, and then (3) selected Export to Excel. It will ask if you want to export 1 table – for this purpose, yes.
The Excel sheet below was exported. The values that were causing the error originally are highlighted below. I cleared these values.
Once I cleared the values, I saved the Excel spreadsheet. I went back into the Configuration Package in D365 Business Central. I selected the table (Sales Order Header) and again (1) went to the tables menu, (2) selected Excel, and (3) selected Import From Excel.
The following window will be displayed. Select the Choose button to select the file that was saved above.
Once you select your file, the system will start working on bringing the file into the configuration package.
At this point, the file has been imported but has not been used to update any records in the environment. (1) Go to the tables menu, (2) select the functions item, and (3) select apply data. This will cause the data imported to update the data in the system. In this case, it will clear the Shipping and Invoicing Document numbers.
A message is displayed showing that the system is working on applying the package, i.e. updating the records in the affected table.
Once completed, the system will give you a message stating how many tables, errors, and inserted records have been modified.
Once completed, the error resolved, and my client was able to post the problem invoices without issue. (Meanwhile, I did the happy dance.) My trusty friend, otherwise known as the configuration package, came through, and now I have one more reason to use and love this tool.
Questions? As a Microsoft Gold Partner, FMT understands that your business is unique and won’t fit a pre-determined mold. We can help you select and implement the right ERP solution for your business, so you can get the maximum value out of your system. Give us a call at 833-827-4276 or contact us here if you have any questions.