Overflow error

Hi All,

I am getting a error msg at the time of posting a Gen. Journal in Nav 5.0 SP1 In version Db. Plz look the error msg screen first


After debugging the code I hv come across the place where error evokes.Codeunit 12 Function name InsertIntoBatchHeader()


The length of the two fields “Deductor Address” and “Deductor Address 2” is 25 of the table Batch Header(ID 16503) and length of the two fields Address and “ Address 2” is 50 of the table Company Information (ID 79). This is why we are facing the problem ??

What is the best solution forit ??

To increase the length from 25 to 50 ??[:P]

Thanks with regrads.

Hi Subrata,

Yes, the length of the two text fields must be the same.

Hi Subrata,

As Erik says, the easiest (at least to begin with) would be to change the length of the 2 fields, so that they are the same.

You have to make sure this is done throughout the database.
Say you change the length on the Batch Header table, then if you also have a Posted Batch Header tabel, you also have to extend the fields here, or you’ll end up getting the same overflow error, this time just at another point in your posting routine. And so on…

Shortening the length of the address fields in Company Info could of course also be a solution, and i would think it was probably the solution that would give the least headaches afterwards.

I can’t help but think why the length of the fields in the Batch Header table is set to 25. By default NAV suggests that a field of type Text is set to a length of 30.
That indicates to me, that someone actively chose the length of 25, and maybe that was done for a reason… You should also check that out first, in my opinion.

Finally you must not forget that you can choose to manipulate the content of the fields in the Company Info table, while copying the values to the Batch Header table.
The simplest one would be to just copy as much as the field-definition allows.
BatchHeader.“Deductor Address” := COPYSTR(CompInfo.Address,1,MAXSTRLEN(BatchHeader"Deductor Address"));

Thanks to both.## Dear Alexander Pallesen,#### 1. Can you send me the Table ID of the Posted Batch Header table.It can’t find it in my DB( Nav 5.0 SP1 IN Version).#### 2. BatchHeader.“Deductor Address” := COPYSTR(CompInfo.Address,1,MAXSTRLEN(BatchHeader"Deductor Address"));#### I think, this will store incomplete Company Name in the field Deductor Address.

BTW, many thanks to you for your quick guidance


I don’t know if such a table exists…
I said IF you have…
It was just an example of how extending the length of the field could spread out like rings in the water…
From the object-ID you mention, i would think this is part of localization.

And yes…
Using the COPYSTR introduces the risk that you store “incomplete” values…

Thank you Alexander for your support and suggestions

There is no “Posted Batch Header” table in the Indian version of NAV 5.0 SP1.