Divide by Zero — NAV Reports.

Naresh Vaneshwar
Nareshwar R.
Published in
2 min readApr 16, 2016

I was trying to find the error, Divide by Zero when writing expressions on Microsoft Dynamics NAV Report Data Source, so I break the test into three scenarios.

Scenario 1

I have set the value = 0 in a setup table (Sales & Receivables Setup, Table 311) and call it in the expression.

image 1a.

and the result is,

image 1b.

Scenario 2

Directly called the expression.

image 2a.

and the result is,

image 2b.

Scenario 3

Assign the expression into a variable and adding the variable into the Data Source.

image 3a.

and the result is,

image 3b.

In scenario 1 and 2, the Role Tailored stopped working, hence I prefer not to write expressions on Data Source column because it does not handle the error. Scenario 3 handles the error in a developer perspective.

If the .gif doesn't load good, hit here. ❤

--

--

Naresh Vaneshwar
Nareshwar R.

Technical findings and new developments on Business Central