The field below must be included in the table's primary key

gemini_shootergemini_shooter Member Posts: 149
Hello All,

I am working with syncing country codes. We have some Lanham objects installed. So my country code table 9 schema looks like this
Enabled	Field No.	Field Name	Data Type	Length	Description
Yes	1	Code	Code	10	
Yes	2	Name	Text	50	
Yes	6	EU Country/Region Code	Code	10	
Yes	7	Intrastat Code	Code	10	
Yes	8	Address Format	Option		
Yes	9	Contact Address Format	Option		
Yes	14000701	ISO 2 char Country Code	Code	2	
Yes	14000761	ISO 3 digit Country Code	Code	3	
Yes	14000763	UPS	Boolean		
Yes	14000782	FedEx	Boolean		
Yes	14000803	LTL	Boolean		
Yes	14000942	Airborne	Boolean		
Yes	14050401	DHL	Boolean		
Yes	14050451	Rating Engine	Boolean		
Yes	14050501	USPostal	Boolean

When I try to change the Country Code I get the following error

The field below must be included in the table's primary key
Field: ISO 2 char Country Code
Table: Country/Region

I tried updated the key to the following
Enabled	Key	SumIndexFields	KeyGroups	MaintainSQLIndex	MaintainSIFTIndex	Clustered	SQLIndex
Yes	Code			Yes	Yes	Yes	
Yes	EU Country/Region Code			Yes	Yes	No	
Yes	Intrastat Code			Yes	Yes	No	
Yes	ISO 2 char Country Code			Yes	Yes	No

The error is still there ... can anyone help

Thank you

Comments

  • kinekine Member Posts: 12,562
    I assume that the problem is in some table with field which have table relation to the ISO field instead primary key of the table and this is not possible.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • cokamaksimoviccokamaksimovic Member Posts: 11
    kine wrote:
    I assume that the problem is in some table with field which have table relation to the ISO field instead primary key of the table and this is not possible.
    @kine: Thanx a lot for this post - you are right! - this is the problem - a table relation cannot be made to a field which is not part of the primary key in a table

    :thumbsup: :)
    ...the best that life offers us is the possibility to enjoy the moment...
  • tularamtularam Member Posts: 97
    I have the same problem and included that on the pirmary key
    i can modify it directly on table but not via another form.. plz help
Sign In or Register to comment.