Protect_Key_State - DataDictionary
Determines whether users are prevented from changing the values of key fields
Type: Property
Access: Read/Write
Data Type: Integer
Parameters: None
Syntax
Property Integer Protect_Key_State
| Access Type | Syntax |
|---|---|
| Read Access: | Get Protect_Key_State to IntegerVariable |
| Write Access: | Set Protect_Key_State to IntegerVariable/Value |
Description
Protect_Key_State determines if the fields that make up a primary key should be "protected" after they have been saved the first time in a new record.
Default value is True.
When set to true, a field identified as being part of a key cannot be edited after it has been saved. This ensures that child records that relate to a parent through a primary key will not become accidentally orphaned.
The fields that make up a primary key are identified by using the Key_Field_State field property.
| Col 1 | Col 2 |
|---|---|
| Note: | Protect_Key_State has no effect if used on a field in a child table that relates to a field in a parent table, because the field's content will be copied from the parent table at a later time during the Attach_Main_File event. |