IRdsDictionary.UpdateSequence

Fore Syntax

UpdateSequence(Options: RdsUpdateSequenceOptions);

Fore.NET Syntax

UpdateSequence(Options: Prognoz.Platform.Interop.Rds.RdsUpdateSequenceOptions);

Parameters

Options. Shift type.

Description

The UpdateSequence method updates sequence.

Comments

Use the IRdsDictionary.Open method to open an MDM dictionary.

Fore Example

Executing the example requires:

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.

Fore.NET Example

Executing the example requires:

This example is a handler of the Click event for the button1 component. Add a link to the Rds system assembly.

Imports Prognoz.Platform.Interop.Rds;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Mb: IMetabase;
    iRdsDatabaseKey, parent: uinteger;
    pDict: IRdsDictionary;
    pDictInst: IRdsDictionaryInstance;
    pData: IRdsDictionaryElementData;
Begin
    Mb := self.Metabase;
    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(True);
    pData := pDictInst.CreateElementData();
    pData.Value[1] := "1";
    parent := -2 As uinteger;
    pDictInst.Insert(parent, pData);
    pData := pDictInst.CreateElementData();
    pData.Value[1] := "2";
    pDictInst.Insert(parent, pData);
    pDict.IsBigDictionary := True;
    pDict.UpdateSequence(RdsUpdateSequenceOptions.rusoKey Or RdsUpdateSequenceOptions.rusoOrder);
    (pDict As IMetabaseObject).Save();
    pDictInst := pDict.Open(Null);
    pData.Value[1] := "3";
    pDictInst.Insert(parent, pData);
    pData.Value[1] := "4";
    pDictInst.Insert(parent, pData);
    pDict.IsBigDictionary := False;
    (pDict As IMetabaseObject).Save();
    Mb.DeleteObject((pDict As IMetabaseObject).Key);
End Sub;

The result of the Fore.NET Example execution matches with that in the Fore Example.

See also:

IRdsDictionary

Related work items