SetRecFieldKey

Mon 01 January 2018

Syntax

SetRecFieldKey(Record.RecordName, Field.FieldName, Key)

Description

Use the SetRecFieldKey function to specify whether a field on a record is a key field or not.

Use the IsKey field class property to determine whether or not the field is already a key.

Note: Because performing this operation changes records, you must subsequently rebuild the project (alter tables).

Parameters

Field or Control

Definition

RecordName

Specify the record containing the field you want to change. This name must be prefixed by the reserved word Record .

FieldName

Specify the name of the field that you want to modify. This name must be prefixed by the reserved word Field .

Key

Specify whether the field is a key or not. This parameter takes a Boolean value: True, the field is a key field, False, it isn't.

Returns

A constant value. The values are:

Value

Description

%MDA_Success

Function completed successfully.

%MDA_Failure

Function didn't complete successfully.

%MDA_RecordNotFound

The specified record wasn't found.

%MDA_RecFieldNotFound

The specified field wasn't found on the record.