UpdateSequence(Options: RdsUpdateSequenceOptions);
Options. Shift type.
The UpdateSequence method updates sequence.
Use the IRdsDictionary.Open method to open an MDM dictionary.
Executing the example requires:
An MDM repository with the OBJ_RDS identifier containing an MDM dictionary with the T_SOURCE_RDS identifier.
A form containing the Button component with the Button1 identifier.
The example is a handler of the OnClick event for the Button1 component. Add links to the Metabase, Rds system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
iRdsDatabaseKey: Integer;
pDict: IRdsDictionary;
pDictInst: IRdsDictionaryInstance;
pData: IRdsDictionaryElementData;
Begin
Mb := MetabaseClass.Active;
iRdsDatabaseKey := Mb.GetObjectKeyById("OBJ_RDS");
pDict := Mb.ItemByIdNamespace("T_SOURSE_RDS", iRdsDatabaseKey).Edit As IRdsDictionary;
pDict.Attributes.Order.Hidden := False;
(pDict As IMetabaseObject).Save;
pDictInst := pDict.Open(Null);
pDictInst.ClearData;
pData := pDictInst.CreateElementData;
pData.Value(1) := "1";
pDictInst.Insert(-2, pData);
pData := pDictInst.CreateElementData;
pData.Value(1) := "2";
pDictInst.Insert(-2, pData);
pDict.IsBigDictionary := True;
pDict.UpdateSequence(RdsUpdateSequenceOptions.Key Or RdsUpdateSequenceOptions.Order);
(pDict As IMetabaseObject).Save;
pDictInst := pDict.Open(Null);
pData.Value(1) := "3";
pDictInst.Insert(-2, pData);
pData.Value(1) := "4";
pDictInst.Insert(-2, pData);
pDict.IsBigDictionary := False;
(pDict As IMetabaseObject).Save;
Mb.DeleteObject((pDict As IMetabaseObject).Key);
End Sub Button1OnClick;
After executing the example MDM dictionary sequence is updated.
See also: