Mandatory: Boolean;
The Mandatory property determines whether empty values are allowed in the field.
If the property is set to True, empty values are not allowed in the field. If the value is False, empty values are allowed.
Executing the example requires that the repository contains a table with the DataTable identifier. The table contains a field with the ID identifier.
Sub UserProc;
Var
MB: IMetabase;
Table: ITable;
Field: ITableField;
Begin
MB := MetabaseClass.Active;
Table := MB.ItemById("DataTable").Edit As ITable;
Field := Table.Fields.FindById("ID");
Field.Mandatory := True;
(Table As IMetabaseObject).Save;
End Sub UserProc;
On executing the example it is prohibited to specify empty values in the ID field.
See also: