item category code

gulamdastagirgulamdastagir Member Posts: 411
iam inserting data into item table using ADO but the issue is when iam inserting an item with item category code character length >10 the insert fails for the record

i tried to increase the item category code for item from the table designer but i get the same overflow error

any ideas?
Regards,

GD

Comments

  • SunsetSunset Member Posts: 201
    First of all. I would seriously consider a solution where you don't have to insert more than 10 charecters into the field. If you change the lenght you are asking for trouble.
    The field is linked to several other tables. All these tables have to be changed in order for you to be able to use the information after you have imported it.
    However if you are looking for an optin to import, and then handle the problems later, it should be enough to increase the lenght in Item (like you have done) and in table "Item Category"
    But as I said, be careful! Everytime a code, table, report etc uses Item Catagory, it will be expecting 10 charecters. And this will create frustrated users as navision will make an overflow error.
    Don't just take my word for it, test it yourself
  • SavatageSavatage Member Posts: 7,142
    use a 10 character or less for the Category code and put your longer full category name in the description field.

    you can chop your code (if you want) better to change it yourself but anyway

    "Item Category".CODE := COPYSTR(YourImportedDataHere, 1, 10);
  • DenSterDenSter Member Posts: 8,305
    Inserting data directly into the Item table with ADO is a bad idea. You should insert the data into a staging table, and have a NAV process insert the date from the staging table into core tables, in such a way that NAV standard bisuness logic is executed, such as field validation.
  • darshanmdarshanm Member Posts: 280
    Before modifying the length of Code field, please check in how many tables it is linked. Instead of doing this you can user a shot codes
    and put details in Description field.

    Because Iem category Code is linked with Sales line, Purchase line and
    so many other tables.
    Darshan Mungekar
    Senior Consultan
  • bbrownbbrown Member Posts: 3,268
    Navision Development 101:

    Code fields are either 10 or 20 Characters

    Master tables have Code(20) fields as primary keys

    Supplemental tables have Code(10) fields as primary keys

    Item Category is a supplemental table. Yiou will have far less problems if you adhere to these and the other rather simple rules when working with Navision.
    There are no bugs - only undocumented features.
Sign In or Register to comment.