Error Importing Sales Invoice into Microsoft Dynamics 365 Business Central Using a Configuration Package: “Attempted to divide by zero”

Microsoft Dynamics 365 Business CentralI was working on a client project recently to help them implement Microsoft Dynamics 365 Business Central. We encountered an error when using a configuration package to import the customers opening balances as sales invoices.

I haven’t yet covered configuration packages in my In Microsoft Dynamics 365 Business Central, how do I… series, but should be doing so fairly soon. Configuration Packages, formerly known as RapidStart, is a tool which allows you to import (or export) data to Business Central from a Microsoft Excel spreadsheet.

We had created a configuration package to update the Gen. Journal Line (81) table which holds the sales journals, selected the fields to import, populated the sheet and run the import, but when we validated the file we were presented with three errors:

Config. Package Errors - Gen. Journal Line

Attempted to divide by zero

We checked the template and batches first to make sure they did, and they did, so concluded these errors were spurious and the important one was the Attempted to divide by zero one.

We manually input one of the transactions into the Sales Journal (253) page and didn’t encounter a problem. It occurred to me that the issue might be the processing order of the table in the configuration package:

Gen Journal Line page in the configuration package

The Currency Code was set to be processed before the Amount field. I moved the Currency Code down one in the processing order and re-ran the validation:

Gen Journal Line page in the configuration package with Currency Code moved below Amount

When we ran the validation again, there were zero errors produced.

The same processing order is required for the Purchases Journal and, I would assume, other journal imports, but these are the two which we have updated and tested.

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.

Your Name

Your Email

Suggested Topic

Suggestion Details

Leave a Reply

Your email address will not be published. Required fields are marked *