Error renaming record under SQL

Martin_Z.
Member Posts: 3
When I try to rename an Item record in a SQL database I get the error: "The field Productgroupcode has to be added to the primary key in table Item". It looks like it stops at the Bin Content Type table. It happens when I try it on the Item card and in the Item table. In the rename trigger I have only the standard navision code.
I can't debug this error and code coverage does not seem to give any information. When I perform this action in the same company in a C-Side database I don't seem to have that problem.
Is there anybody who can give me a clue what could be wrong? Thanx in advance!
I can't debug this error and code coverage does not seem to give any information. When I perform this action in the same company in a C-Side database I don't seem to have that problem.
Is there anybody who can give me a clue what could be wrong? Thanx in advance!

0
Comments
-
You use RENAME only when you change values in primary key fields. Product Group is not part of the primary key of the Item table, at least not in standard Navision. Try using MODIFY instead.0
-
Martin Z. wrote:When I try to rename an Item record in a SQL database I get the error: "The field Productgroupcode has to be added to the primary key in table Item". It looks like it stops at the Bin Content Type table. It happens when I try it on the Item card and in the Item table. In the rename trigger I have only the standard navision code.
I can't debug this error and code coverage does not seem to give any information. When I perform this action in the same company in a C-Side database I don't seem to have that problem.
Is there anybody who can give me a clue what could be wrong? Thanx in advance!
You have a field in a table relationed to item."Product Group Code". Change this relation to something like ""Product Group".Code WHERE (Item Category Code=FIELD(Item Category Code))"
bye
MatteoReno Sistemi Navision Developer0 -
Yep, you are correct Matteo. I found it out allready but thanks for your reply!
I exported all tables to text and search for all tablerelations with Item and found it. There was a relation from a tablefield to item."product group code". I changed it to just Item and everything worked just fine.
Can you explain to me why this was not a problem in C-Side?0 -
Hi,
I have a same problem, but with a decimal type field. It's a new field in table Insurance in SQL database. A error is "A field below must be included in the table's primary key. "
What can I do??
:-k
Thanks0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions