Keys

A key is a field or combination of fields in a table that is used to sort and locate specific rows in the table. Typically, the value of the key field or fields is unique for each row in a table so a specific row can be located. Keys that don't uniquely identify a specific row are used to refer to a range of rows in the table.

The keys for a table are identified by number, beginning with the value 1. When you specify the key you want to use for a table, you will supply the corresponding integer. The Table Descriptions window in Microsoft Dynamics GP lists the keys for each table, and the key segments (fields) that each key contains.

Cc543584.VSTDGP_KeyDetails(en-us,MSDN.10).gif

You will use the keys for a table when you retrieve a specific row from the table. This is described in the next section, Retrieving a row. You will also use keys when you want to perform operations on a range of rows in the table. You will learn more about this in Ranges.