Problem Renaming Item.

HoeghHoegh Member Posts: 3
Hi there.

My customer is trying to rename a record in the "Item" table, but gets this weird error. The scenario is this:

When all of the following is true:
* NAV is version 5.0.
* NAV is running on SQL (this problem does not occur with a native database).
* There is at least one record in the "Item Variant" table (5401), attached to the Item that is to be renamed.
* The new Item No. exceeds 10 characters.

Then, when I try to rename the Item, I get this error:
The contents in the Item No. field cannot be copied to the Variant Code field because the size of the Variant Code field is too small.

Type: Code10 <-- Code20
Field: Variant Code <-- Item No.
Table: Average Cost Calc. Overview <-- Item Variant

The table relation properties in NAV look alright to me, so I can't figure out how NAV manages to link the Item No. to the Variant Code field. I suspect that the error lies somewhere in SQL server, but I am not sure about what to look for or where to look for it.

The table "Average Cost Calc. Overview" table (5847) is completely empty. I even made a brand new database, and imported the Cronus backup into it, and the error also happens there, given the same set of surcomstances as mentioned above is present.

If anyone knows about this, I would be happy to hear about it.

Thanks.

Hoegh ](*,)

Answers

  • SavatageSavatage Member Posts: 7,142
    it seems to be trying to put the item No into the Varient Code field

    Item Variant
    Code-Type:Code-Size 10
    Item No.-Type:Code-Size 20
    :-k
  • i4tosti4tost Member Posts: 208
    Activate debuger because i feel that there is a probem in NAV code, not in relation.
    If there is still an error, use developer toolkit to find relations from Item table to other objects
    Hope it helps.
  • kinekine Member Posts: 12,562
    There is wrong TableRelation on the "Variant Code" field in this table. There is :"Item Variant" WHERE (Item No.=FIELD(Item No.))

    but because PK of Item Variant table is "Item No.,Code" (Item No. is on the first position) it will take the Item No. Change the TableRelation to ""Item Variant".Code WHERE (Item No.=FIELD(Item No.))" and it will be OK.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • HoeghHoegh Member Posts: 3
    kine wrote:
    Change the TableRelation to ""Item Variant".Code WHERE (Item No.=FIELD(Item No.))" and it will be OK.

    It works like a charm! Thank you very much!

    Hoegh
  • kinekine Member Posts: 12,562
    You are welcome!
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.