FieldSchemeService

Hierarchy

  • FieldSchemeService

Methods

isFieldOfType

  • Checks whether the field matches the specified data type.

    Type parameters

    Parameters

    Returns field

    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) 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 
    }