IABACAttributeInstance.Value

Syntax

Value: Variant;

Description

The Value property determines an attribute value.

Comments

This property is relevant when the custom attribute value is edited.

To determine default attribute value, use the IABACAttribute.DefaultValue property.

Example

To execute the example, make sure that an integer custom attribute with the WORKDAYS identifier is added for users.

Add links to the ABAC and Metabase system assemblies.

Sub UserProc;
Var
    Insts: IABACAttributeInstances;
    Inst: IABACAttributeInstance;
    MB: IMetabase;
    MS: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    // Get license to be able to work with the security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    // Get attributes of the first user
    User := MS.Users.Item(0);
    Insts := User.Attributes;
    // Find attribute with the WORKDAYS identifier
    Inst := Insts.FindById("WORKDAYS");
    // Check whether value of the found attribute is multiple
    If Inst.IsArray = False Then
        // Change attribute value if it is not multiple
        Inst.Value := 20;
    End If;
    // Save changes in security manager
    MS.Apply;
    // Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the attribute value with the WORKDAYS identifier is changed for the specified user.

See also:

IABACAttributeInstance