Understanding the Functional Primary Key
Functional Primary Key Definition
The Functional Primary Key is defined by the administrator in the quote model. A Functional Primary Key is defined for a given Line Template (See Anatomy of a quote section) with the following properties:
- an ordered list of columns
- a policy (no control, conflicts, no duplicate)
- an option to take into account the hierarchy
HIERARCHY
The hierarchy flag defines if the hierarchy is taken into account for the FPK calculations. That means a line is not considered duplicated if added in different folder.
Example
In the following example, we assume that all lines are bound to the same Line Template The following quote is created:
Hierarchy/No hierarchy
The following line templates are defined with the following FPK: LT1
- columns: Location
- Take hierarchy into account: false
LT2
- columns: Location
- Take hierarchy into account: true
At runtime, the following lines will be added
| PRODUCT | LOCATION | (LINETEMPLATE) | (COMPUTED FPK) |
|---|---|---|---|
| Apples | Cugnaux | LT1 | Cugnaux |
| Forks | Cugnaux | LT2 | /Cugnaux |
In that case, as one line template takes into account the hierarchy and the other not, the 2 lines don't have the same FPK.
FPK with Business columns
When a Business type column is part of the FPK, only the Name is taken into account. For example, for the following Standard Item workspace/SI/siProduct, only siProduct is taken into account for the FPK.
Same FPK and different line types
2 lines can have the same Functional Primary Key and bound to 2 distinct line types. Indeed, the same definition of the FPK can be done on different line templates.
Functional Primary Key Usage
CONFLICT RESOLUTION AND CONTROL OF DUPLICATES
Performance quoting allows to prevent a user from having duplicate lines in the quote. To do so, a policy can be defined per line template and is associated to an FPK.
- No control: A line with a given FPK can be added multiple times in the quote.
- Conflicts: A line with a given FPK can be added multiple times in the quote, but this will raise a Warning. This allows a user to temporarily add multiple identical lines in the quote before finalizing the quote and cleaning the errors.
- No duplicate: A line with a given FPK is unique in the quote. A similar line will not be added in the quote if it already exists.
By default (if nothing is specified on the line template), the FPK will be defined with the system column RowItem, the policy will be set to NO CONTROL and the hierarchy is not taken into account.
MATCHING LINES DURING IMPORT
During an import process, the lines that are part of the imported file are tentatively added to the quote.
The Functional Primary Key (FPK) is used for line matching (when the policy is 'NO DUPLICATE' or 'CONFLICT') during the import process. Once a line is matched, the import policy is applied to decide whether the line being imported is merged with the identical existing quote line, or if it override it or if it is skipped.
REFRESH MECHANISM
During a refresh process, the Functional Primary Key (FPK) can also be used to identify if a product subline before and after a refresh stays the same. This allows to understand if user choices need to be kept or not (Depending on the "Keep User Input" option) (see Understanding Data Refresh in the Quote).
