AddAttribute(AttributeId: String): IRdsAttribute;
AddAttribute(AttributeId: string): Prognoz.Platform.Interop.Rds.IRdsAttribute;
AttributeId. Identifier of the MDM dictionary attribute.
The AddAttribute method adds a filter to the collection by the specified attribute identifier.
The AddAttribute method returns added filter after execution. The filter is added to the end of the collection, and value of the IRdsDictionaryFilterConditions.Count property is increased by one.
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(Null) As 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: