About primary key declaration..

Hey everybody,

I create a table which have fields1,fields2…fields40 and defines which all fields as a datatype “CODE” length 10.I think in navision the primary key is composed of up to 20 fields in a record,and upto “40 keys” can be associated to table.My problem is after defining that primary key “20 fields”.I cant able to define some other fields as a key.I have no clue about that reason.

Advance Thanks for yours valuable suggesstion,

With Regards

Thiyagarajan.M

The reason is that there is a maximum length of your key. I think it was 255 characters… But I might be wrong.

Hey Erik,

ya.,tat may bewrong., the field in active key may not exceed 252 bytes.In my case the field in active key is not exceed 252 bytes its within 252 bytes only,still i cant define some other field as a key.

With Regards,

Thiyagarajan.M

I know you’re right. I tried it my self in NAV 4.00 SP3.

When I add my 21st. key then I’m getting this error: Internal error 1291 in module 19.

There must be a limit not to add more than 20 fields in one key.

Yes, It’s documents that maximum number of field in a Key 20. For details read in Application Designers Guide.

yes,In Application Designers guide has a following information like “upto 40 keys can be associated to a table”,i tried 20 fields as a primary key,after that i cant able to create a single field as a key.

Yes but you’re not trying to add 40 keys, but 20 fields! Not the same!