26 July 2017

Value '-1' is not a valid value. The following values can be used >=0.


Recently one of my colleague was trying to copy "Chart Of Account" to "IC Chart of Account" in NAV 2017 using default "Copy from Chart of Account" functionality. 

This is a really nice functionality available because within a single button click all the accounts in "Chart of Accounts" get copied to "IC Chart of Accounts".

Copying the accounts went smoothly as expected but once the copying finished screen changes to below. 

We first thought it was a refresh issue and just tried to refresh the page, but end up with below error message.
"Value '-1' is not a valid value. The following values can be used >=0."

We open up the IC GL account table and check for indentation and found that "End-Total" has a value of -1. The error went away once we change it back to 0 in the table.

So what went wrong? 

The first point to check was "Chart of Account" indentation and it was all OK. All set to 0. 

To understand what went wrong we open up the Page 605 and went to the "CopyFromChartOfAccounts" function. 

As highlighted in below for every "End-Total", program -1 from the current indentation value. Since "Chart of Account" indentation is set to 0, end-values in "IC Chart of Account" end up with -1. 

This built-in logic is totally acceptable if the Indent "Chart of Account" is done as below. 

Once the "Indent Chart of Accounts" is done, "Copy from Chart of Accounts" worked like a charm.

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara
Read more »