If the value istrue, the field matches the specified type. If false, it doesn't match.
const fieldCode = 'someenumfield';
const field: FieldScheme | undefined = scheme.fields.find(f => f.code === fieldCode);
if (!field) thrownewError('Field not found');
if (System. scheme.field.isFieldOfType(field, FieldSchemeType.ENUM)) {
// Here the 'field' type's type is ENUM, its additional settings are available const enumData = field.data; // The enumData type will be ApplicationSchemeFieldEnumData | undefined
}
Service for retrieving app field information
Hierarchy
Methods
isFieldOfType
Checks whether the field matches the specified data type.
Type parameters
T: FieldSchemeType
Parameters
field: FieldScheme
type: T
Returns field
If the value is
true, the field matches the specified type. Iffalse, it doesn't match.const fieldCode = 'someenumfield'; const field: FieldScheme | undefined = scheme.fields.find(f => f.code === fieldCode); if (!field) throw new Error('Field not found'); if (System. scheme.field.isFieldOfType(field, FieldSchemeType.ENUM)) { // Here the 'field' type's type is ENUM, its additional settings are available const enumData = field.data; // The enumData type will be ApplicationSchemeFieldEnumData | undefined }