overflow under type conversion of code to code

Dear All,

Can somebody help me:

I got this error: Overflow under type conversion of code to code Value: 1589

Actually, this 1589 is the category value for an item. Last time, when we made the item card for the item, only 3 text are allowed for the category and I asked our NAV provider to increase it to 4 text. Now its accepting 4 text for the category.

now the problem is when you are making invoices or orders, when you choose an item.this error messages pop out.

Can somebody help me thanks :slight_smile:


I do not know the code behind, but this sounds like not all relevant code has been updated to handle 4 characters instead of 3. If you are able to used the debugger you might activate (without ‘Breakpoint on Triggers’ on) and execute your action again and see where the debugger jumps.


They have expanded the field on the item card, but not in any of the related posting routines. You need to get your partner to expand the code in all other areas, not just the item card. The issue here is you are trying to put a 4 digit field into a 3 digit field, hence the error. Another way around this would be to reset teh code to 3 - your invoice would then post, this will be quicker than the redesign I would guess, but it depends on your priorities.

Hi, I got the same error. Can I ask for you help the easiest way to change all related posting routines? In this case I cannot reset the code to its original because it is the way the client wants to do their codes.

Are you speaking about Item Category field? It’s Code(10) in standart… Still to short for your needs?

There is no easy way, (and that for it’s not advised to change standart fields) - as answered above already, if you change length of a field, you must go through all objects where this field is referenced - other tables, forms, reports, all code (variables that hold this field must be adjusted).

It is really a nightmare to do, and will cause you huge problems when you will do version upgrade later…

Don’t change the length of fields in Navision.

hi ,

we had also same problem,

we have the item master table and item ledger entry table whenever you add the item and used it in any transactions it gets

reflected to item ledger entry table. check the item code field in the item ledger entry table and make it 4 digit, and then try to post it.

this may help to solve your problem.

I believe you are correct. And actually I’ve been encountering a lot of these prompt message everytime I do transactions. I appreciate all your help. The only way is to concatenate codes am I right? Only then if my client will agree, because most of our clients have their standard codes. That’s why much better if we can fit them based on their requirements.

right, have you tried the solution. please let me know if it helps to solve your problem.

I did the same, change the Item ledger entry table. I set the length for item code to 100. Still the same. Now I am doing BOM Journals, then the error prompt. I checked BOM Journal Line and item code was set to 100 also.

This is going to be a VERY VERY long piece of string. You will need to alter this everywhere it is called in this format, all of the tables, reports, codeunits etc etc. You will be doing this for months because entries like the item number go everywhere. I suggest you both stop now, set it back to how it was an think about the reason for change.

I understand. But codes are very important to them. They just can’t concatenate it, they have been using these codes since then and just because the system cannot provide it changes how they want it to be. Please help me explain it further or are there any other options. I believe there’s someone else does the same as I am. Or is there anybody who has encountered the same problem as mine. I am open for any other suggestions this is very important. I appreciate all your efforts. Thank you so much!

to keep it simple, you can make use of other field in item table. choose any field which is not used currently. or if not, you can add new field, only in Item table.

later, when you create reports, if this field is required, you can always call this item (table) as a record, use GET or SETFILTER or such as, and call this field.

You really are not thinking clearly though - why this code? Why this field? What purpose does it serve? What does it need to do? Is your client willing to pay for months of development because it is important to them?

Without knowing the point of the field, what you want it to do, what the requirement is of teh field fit and function it is difficult to suggest, but why not add another field and use this? Why not use an existing field that does not need expanding?

mostly this code to code and code to text overflow applies on the address or descriptions this error can check in the C/AL editor


you need to liaise with your navision providers to modify this errors since it cannot be edited by the navision end user.

Only the Navision developer can help you out upon this.



Please read my blog here


I think there is no real way we convince you to do this right, but at least make sure you learn so you don’t ruin the next customers system.

It has been written already several times, but you don’t want to listen…

DON’T change length of Code (Item, Vendor, Customer etc etc) and Description fields. Do some search in forum - there is a bazilion of threads about this theme, why it can not be done and what the consequences will be if you try to.

Instead, ADD your own customized fields of needed length for this purpose.

And please believe, if two MVP’s, several Moderators and some more members in this one tread only all have said DO NOT, they have significant reason (and knowledge) of doing so… Again, read the additional info you were pointed to, search the forum for “increase lenght”.

BTW this “field length issue” is one of eternal themes here in forum, popping up at least once every couple of months… [:D]

Hi Michael,

Which part in the C/AL editor I can check the error? I also tried to concatenate the item code, but when I take up the item for BOM Journal still the error prompt. Thanks

where exactly you encounter that error?? on what table name