IRdsDictionaryFilterConditions.AddAttribute

Syntax

AddAttribute(AttributeId: String): IRdsAttribute;

Parameters

AttributeId. Identifier of the MDM dictionary attribute.

Description

The AddAttribute method adds a filter to the collection by the specified attribute identifier.

Comments

After executing, the method returns settings of the added filter. The filter is added to the end of the collection, and value of the IRdsDictionaryFilterConditions.Count property is increased by one.

Example

Executing the example requires an MDM repository with the RDS_REPO identifier that contains a non-version MDM dictionary with the DICT identifier. The dictionary contains an attribute of logical type with the ACTUAL identifier.

It is also necessary to add links to the Metabase, Rds system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    RdrRepoDescr: IMetabaseObjectDescriptor;
    RdsDictObj: IMetabaseObject;
    DictInst: IRdsDictionaryInstance;
    DictBatch: IRdsDictionaryBatch;
    DelBatch: IRdsDictionaryBatchDelete;
    BatchFilters: IRdsDictionaryFilterConditions;
    Filter: IRdsDictionaryFilterCondition;
Begin
    mb := MetabaseClass.Active;
    RdrRepoDescr := mb.ItemById("RDS_REPO");
    RdsDictObj := mb.ItemByIdNamespace("DICT", RdrRepoDescr.Key).Edit;
    DictInst := RdsDictObj.Open(NullAs IRdsDictionaryInstance;
    DictBatch := DictInst.CreateBatch(RdsDictionaryBatchType.Delete);
    DelBatch := DictBatch As IRdsDictionaryBatchDelete;
    BatchFilters := DelBatch.Filter;
    Filter := BatchFilters.AddAttribute("ACTUAL");
    Filter.Value := False;
    DelBatch.Execute;
    RdsDictObj.Save;
End Sub UserProc;

After executing the example a batch used to delete elements is created. A filter by a value of the ACTUAL attribute is created for the batch. Then the batch is executed.

See also:

IRdsDictionaryFilterConditions