Primary Key on Item table problem

Johannes_NielsenJohannes_Nielsen Member Posts: 206
Hi all :)

Running NAV 5.0 on SQL 2008

I get the attached error when renaming an Item (both form the Item Card and directly on table)

The error states that a Custom field should be part of the Primary Key.

I've found this solution which I executed on a copy of the db.

- Populated the No.2 field with uniqe values from No. field
- Promote No.2 to Primary key
- Reset the Primary key to No. field

So I'm asking
  • Is this "fix", safe to execute on my production db?
  • What could cause the error?
  • Are there other ways of fixing this?
Best regards / Venlig hilsen
Johannes Sebastian
MB7-840,MB7-841

Answers

  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Update: The copied database was converted to Native.
    Doing the "fix" on a copy, still on the SQL, does not solve the issue :(
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    :oops: Excuse me everyone, I solved the issue using this posting
    http://mibuso.com/forum/viewtopic.php?f=23&t=41185&hilit=the+following+field+must+be

    We had a custom table with a field and a table relation to the actual field in Item table

    I changed "ValidateTableRelation" to "No".

    I guess this table tried to validate values that was no more, in Item table. Causing the error when renaming an Item.

    Sorry for any inconvenience :whistle:
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
Sign In or Register to comment.