Expressions on Data Source column on NAV Reports

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

This post is regarding an error message that the Dynamics NAV could not trigger it on run-time.

I wrote the math expression right away on the Data Source column of a report object which as it is displayed on image 1a.

image 1a.

The math expression is: ROUND((SumOfScrap / “Capacity Ledger Entry”.”Output Quantity”) * 100, 0.01)

When I run the report, it loaded me the request page, but when I try to preview it, NAV did not give any sort of preview or error messages.

After analyzing the dataset, and I moved the math expression into the OnAfterGetRecord() trigger. When I run the report, NAV threw me an error as you can see on image 2b.

image 2b.

The reason for this error is, “Capacity Ledger Entry”.”Output Quantity” is 0 in a few records of the dataset.

This is a basic level of error handling must have been considered, but NAV pointed me out when I added into a specific trigger, but not when it was a math expression on the Data Source column.

So I added a chunk of code assigning the math expression result to a decimal variable, in order to handle as simple as it can be.

So, making a note to myself about sticking to the basics.

--

--

Naresh Vaneshwar
Nareshwar R.

Technical findings and new developments on Business Central