SetDimHierarchiesSettings

Syntax

bool SetDimHierarchiesSettings(DmId tDim, DimHierarchiesSettingsArg tArg)

Parameters

tDim. Dictionary instance moniker.

tArg. Operation execution parameters.

Description

The SetDimHierarchiesSettings operation changes information about dictionary alternative hierarchies.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetDimHierarchiesSettings xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDim xmlns="">
  <id>S1!M!S!DM1</id>
  </tDim>
<tArg xmlns="">
  <hiersOper>Add</hiersOper>
<hiers>
<its>
<it>
  <k>-1</k>
  <id />
  <n />
  <vis>true</vis>
  <sourceDimKey>154</sourceDimKey>
  <sourceDimCls>1025</sourceDimCls>
  <originalDimKey>293441</originalDimKey>
<sourceIndex>
  <k>156</k>
  <id>INDEX1</id>
  <n>Index1</n>
  <vis>true</vis>
  </sourceIndex>
<attributesBindings>
<it>
  <originalAttrId>NAME</originalAttrId>
  <sourceAttrId>NAME</sourceAttrId>
  </it>
<it>
  <originalAttrId>ID</originalAttrId>
  <sourceAttrId>ID</sourceAttrId>
  </it>
<it>
  <originalAttrId>ORDER</originalAttrId>
  <sourceAttrId>ORDER</sourceAttrId>
  </it>
<it>
  <originalAttrId>PARENT</originalAttrId>
  <sourceAttrId>PARENT</sourceAttrId>
  </it>
  </attributesBindings>
  </it>
  </its>
<originalIndex>
  <k>155</k>
  <id>INDEX1</id>
  <n>Index1</n>
  <vis>true</vis>
  </originalIndex>
  </hiers>
  </tArg>
  </SetDimHierarchiesSettings>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetDimHierarchiesSettingsResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</SetDimHierarchiesSettingsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}
}

JSON response:

{
"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:

Working with Dictionaries