VisibleForEdit: TriState;
VisibleForEdit: Prognoz.Platform.Interop.ForeSystem.TriState;
The VisibleForEdit property determines whether an attribute value is available to edit in a card of a dictionary element.
Available values of the property correspond to elements of the enumeration TriState:
OnOption. Attribute value is always available to edit in a card of element.
OffOption. Attribute value is never available to edit in a card of element.
Undefined. Set by default. Attribute value is available to edit in a card of element if an attribute is not hidden.
Value of the VisibleForEdit property affects values of the IRdsAttribute.Nullable and IRdsAttribute.Hidden properties in the following ways:
Attribute is not hidden, compulsory and available in a card of element depending on settings of hidden, i.e. Hidden = False, Nullable = False, VisibleForEdit = TriState.Undefined. If an attribute is hidden Hidden = True, it becomes optional automatically Nullable = True. It is impossible to make it compulsory if it is hidden.
If an attribute is compulsory Nullable = False and VisibleForEdit = TriState.OffOption an attribute becomes optional automatically Nullable = True. If VisibleForEdit = TriState.OffOption it is impossible to make an attribute compulsory.
If an attribute is always displayed in a card of element VisibleForEdit = TriState.OnOption, the Hidden and Nullable properties do not influence on one another.
So, value of the IRdsAttribute.Nullable property must be changed the last.
Executing the example requires an MDM repository with the RDS identifier that contains a dictionary with the DICT_RDS identifier. Add links to the Metabase, Rds, Dal system assemblies.
Sub UserProc;
Var
mb: IMetabase;
RdsKey: Integer;
RdsDict: IRdsDictionary;
RdsAttr: IRdsAttribute;
Begin
mb := MetabaseClass.Active;
RdsKey := mb.GetObjectKeyById("RDS");
RdsDict := mb.ItemByIdNamespace("DICT_RDS", RdsKey).Edit As IRdsDictionary;
RdsAttr := RdsDict.Attributes.Add;
RdsAttr.Id := "USER_ATTR";
RdsAttr.Name := Country;
RdsAttr.DataType := DbDataType.String;
RdsAttr.VisibleForEdit := TriState.OnOption;
(RdsDict As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a new attribute is added in a dictionary; this attribute is always available to edit in a card of dictionary element.
Executing the example requires an MDM repository with the RDS identifier that contains a dictionary with the DICT_RDS identifier.
Imports Prognoz.Platform.Interop.Rds;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
RdsKey: uinteger;
RdsDict: IRdsDictionary;
RdsAttr: IRdsAttribute;
Begin
mb := Params.Metabase;
RdsKey := mb.GetObjectKeyById("RDS");
RdsDict := mb.ItemByIdNamespace["DICT_RDS", RdsKey].Edit() As IRdsDictionary;
RdsAttr := RdsDict.Attributes.Add();
RdsAttr.Id := "USER_ATTR";
RdsAttr.Name := Country;
RdsAttr.DataType := DbDataType.ddtString;
RdsAttr.VisibleForEdit := TriState.tsOnOption;
(RdsDict As IMetabaseObject).Save();
End Sub;
After executing the example a new attribute is added in a dictionary; this attribute is always available to edit in a card of dictionary element.
See also: