bool SetDimHierarchiesSettings(DmId tDim, DimHierarchiesSettingsArg tArg)
tDim. Dictionary instance moniker.
tArg. Operation execution parameters.
The SetDimHierarchiesSettings operation changes information about dictionary alternative hierarchies.
The operation creates new or deletes alternative hierarchies and also changes settings of existing alternative hierarchies. To execute the operation, in the tDim field specify the dictionary moniker, and in the tArg field specify parameters for changing alternative hierarchies. The moniker can be obtained on executing the OpenDim operation. Use the SaveObject or SaveObjectAs operation to save the dictionary after the changes are made.
The operation results in the logical True if changes were applied successfully.
Below is the example of adding an alternative hierarchy to dictionary structure. The request contains moniker of dictionary instance and parameters of the alternative hierarchy to be created. The response contains whether creating was successful.
{
"SetDimHierarchiesSettings" :
{
"tDim" :
{
"id" : "S1!M!S!DM1"
},
"tArg" :
{
"hiersOper" : "Add",
"hiers" :
{
"its" :
{
"it" :
[
{
"k" : "-1",
"id" : "",
"n" : "",
"vis" : "true",
"sourceDimKey" : "154",
"sourceDimCls" : "1025",
"originalDimKey" : "293441",
"sourceIndex" :
{
"k" : "156",
"id" : "INDEX1",
"n" : "Index1",
"vis" : "true"
},
"attributesBindings" :
{
"it" :
[
{
"originalAttrId" : "NAME",
"sourceAttrId" : "NAME"
},
{
"originalAttrId" : "ID",
"sourceAttrId" : "ID"
},
{
"originalAttrId" : "ORDER",
"sourceAttrId" : "ORDER"
},
{
"originalAttrId" : "PARENT",
"sourceAttrId" : "PARENT"
}
]
}
}
]
},
"originalIndex" :
{
"k" : "155",
"id" : "INDEX1",
"n" : "Index1",
"vis" : "true"
}
}
}
}
}
{
"SetDimHierarchiesSettingsResult" : "1"
}
public static bool AddHierarchy(string moniker, DmHier newHierarchy, ItEntity index)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetDimHierarchiesSettings()
{
tArg = new DimHierarchiesSettingsArg()
{
hiersOper = ListOperation.Add,
hiers = new DimHierarchies
{
its = new DmHier[1]
{
newHierarchy
},
originalIndex = index,
}
},
tDim = new DmId() { id = moniker }
};
//Add a new hierarchy
var result = somClient.SetDimHierarchiesSettings(tSet);
return result;
}
See also: