Hi,
I have been reading posts for a while but never posted.
I have just started going over C/SIDE dev I chapters and have a newbie question regarding Secondary keys.
Are the Secondary keys in Navision unique?
E.g. primary key is Serial No which is obviously unique.
Must the secondary key also be unique?
Thanks in advance.
0
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thanks.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
No because the doesn't not have a property to make the key unique. So even if you wanted to make a secondary key unique, you would not be able to do it.
Yes because NAV internally makes sure that all primary key fields are also included. So looking at the Sales Header table, which has DocType and DocNo as the primary key, when you add a key for SelltoCustomer, inside the object NAV will add both primary key fields to the key. You don't see this in the actual key design, but it is done behind the scenes. It is still technically not a unique key constraint though, because you can have the same combination of secondary key field combination more than once in the table.
On SQL Server, you can see this clearly by looking at the indexes. You'll see the primary key fields added to the corresponding index, and the index is defined to be a unique index. Now when you define the index that you want SQL Server to use in the SQLIndex property, then NAV does NOT add the primary key fields to the index, and the Unique constraint is not set.
RIS Plus, LLC
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC