The primary key of a table is meant to uniquely identify a record. In any database management system, there can only be one primary key.
What Navision is missing though is a setting to enforce a secondary key to only store unique values, although I've only seen one instance in which this is useful. So if you want to keep certain combinations of field values unique, you will have to program something yourself.
The GET method can only reliably be used on primary keys. using any other key I would set filters on the fields and do a FIND('-'), and using the return value of the FIND method, combined with COUNT to determine whether a value combination is unique.
Comments
You can change it, and if you change it you must change your Gets. Gets are always using the primary key.
You could also add a secondary key and access it for example via Setcurrentkey, SetFilter and then a Find.
Success
www.dasautomatisering.nl
What Navision is missing though is a setting to enforce a secondary key to only store unique values, although I've only seen one instance in which this is useful. So if you want to keep certain combinations of field values unique, you will have to program something yourself.
The GET method can only reliably be used on primary keys. using any other key I would set filters on the fields and do a FIND('-'), and using the return value of the FIND method, combined with COUNT to determine whether a value combination is unique.
RIS Plus, LLC