IABACAttribute.UIEditorBinding

Syntax

UIEditorBinding: String;

UIEditorBinding: System.String;

Description

The UIEditorBinding property determines a date and time format in attribute value.

Comments

Use the property if the conditions are satisfied:

The value of the UIEditorBinding property contains date and time format:

Example

To execute the example, add links to the ABAC, Metabase, Dal, ForeSystem system assemblies (for the Fore.NET example).

Sub UserProc;
Var
    ABACAttribute: IABACAttribute;
    ABACAttributes: IABACAttributes;
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to be able to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Add a time attribute for users
    ABACAttributes := MS.Users.Attributes;
    ABACAttribute := ABACAttributes.Add;
    ABACAttribute.Name(MB.CurrentLocale) := 
"Time attribute";
    ABACAttribute.Id := 
"ATTR_TIME";
    ABACAttribute.DataType := DbDataType.DateTime;
    ABACAttribute.DefaultValue := Datetime.Parse(
"22.10.2018 20:00:00"); 
    ABACAttribute.UIEditorBinding := 
"DateTimePicker";
    // Apply changes in security manager
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

Imports Prognoz.Platform.Interop.ABAC;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    ABACAttribute: IABACAttribute;
    ABACAttributes: IABACAttributes;
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to be able to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    
// Add a time attribute for users
    ABACAttributes := MS.Users.Attributes;
    ABACAttribute := ABACAttributes.Add();
    ABACAttribute.Name[MB.CurrentLocale] := 
"Time attribute";
    ABACAttribute.Id := 
"ATTR_TIME";
    ABACAttribute.DataType := DbDataType.ddtDateTime;
    ABACAttribute.DefaultValue := Datetime.Parse(
"22.10.2018 20:00:00"); 
    ABACAttribute.UIEditorBinding := 
"DateTimePicker";
    // Apply changes in security manager
    MS.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example the time attribute is added in the security manager with the value in the format <DD.MM.YYYY HH:MM>.

See also:

IABACAttribute