Table: dbo.Custom_Value
Columns
Name | Type | Constraints | Description
custom_field_KEY | int (4) | NOT NULL |
row_KEY | int (4) | NOT NULL | Contains the key of the record that "owns" this value, like the client or vendor. Will match the related value in the Custom_Value_X table (ex. Custom_Value_Client.client_KEY). Set initially through normal means, but is also maintained via database triggers. The triggers exist to support restoring client data into the database.
custom_value | nvarchar (200) | NOT NULL |
custom_value_KEY | int (4) | NOT NULL | Primary key for this table and FK to the custom value being referenced.
custom_grouping_KEY | int (4) |  | Link to the custom grouping record if this is for a list field. ["BR"]If value is for a grouping field then the grouping key will match (logically) the value in custom_value; ["BR"]null in this column will be an empty string in custom_value. ["BR"]The grouping key will be null if this is for a non-grouping field, and there will be no relationship between ["BR"]custom_grouping_KEY and custom_value.

Primary key
Name | Columns | Description
PK_Custom_Value | custom_value_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_Custom_Value__Custom_Field__custom_field_KEY | custom_field_KEY | Custom_Field (custom_field_KEY) |
FK_Custom_Value__Custom_Grouping__custom_grouping_KEY | custom_grouping_KEY | Custom_Grouping (custom_grouping_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Custom_Value_Staff__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Staff |
FK_Custom_Value_Firm__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Firm |
FK_Custom_Value_Client__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Client |
FK_Custom_Value_Client_Staff__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Client_Staff |
FK_Custom_Value_Customer__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Customer |
FK_Custom_Value_Vendor__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Vendor |
FK_Custom_Value_Employee__Custom_Value__custom_value_KEY | custom_value_KEY | Custom_Value_Employee |