SetDmStdResult SetDmStd(DmId tDim, SetDmStdArg tArg)
tDim. Moniker of opened table dictionary instance.
tArg. Operation execution parameters.
The SetDmStd operation changes table dictionary metadata.
This operation enables the user to change table dictionary structure: attributes, blocks, indexes, dictionary levels and other settings that affect dictionary work. A table dictionary should be opened for edit. To execute the operation, in the tDim field specify table dictionary instance moniker, and in the tArg field specify change parameters. The moniker can be obtained on executing the OpenDim operation. In the tArg.pattern field specify the pattern that will be used to make changes, and in the tArg.meta field specify changed metadata. After making changes save the dictionary by using the SaveObject or SaveObjectAs operation. The operation results in the updated metadata if the tArg.metaGet pattern was specified.
Below is the example of using the SetDmStd operation to change table dictionary structure, that is, a new attributes is added to the dictionary. The request contains the dictionary moniker, the pattern that determines whether it is necessary to add a new attribute, and metadata with specified new attribute parameters. The response contains updated information about all dictionary attributes.
{
"SetDmStd" :
{
"tDim" :
{
"id" : "S1!M!S!DM9"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"attrs" : "Add"
},
"meta" :
{
"attrs" :
{
"its" :
{
"it" :
[
{
"k" : "18446744073709551615",
"id" : "ADDITIONAL",
"n" : "Additional value",
"dt" : "3"
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"attrs" : "Get"
}
}
}
}
{
"SetDmStdResult" :
{
"id" :
{
"id" : "S1!M!S!DM9"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "4",
"@hf" : "0",
"i" : "DIM_1",
"n" : "Dim_1",
"k" : "116",
"c" : "1025",
"p" : "103",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "1",
"attrs" :
{
"its" :
{
"it" :
[
{
"k" : "117",
"id" : "NAME",
"n" : "Name",
"vis" : "1",
"dt" : "1",
"predefined" : "Name",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "118",
"id" : "ID",
"n" : "Identifier",
"vis" : "1",
"dt" : "2",
"uniqueIndex" : "INDEX1",
"predefined" : "Ident",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "119",
"id" : "ORDER",
"n" : "Order",
"vis" : "1",
"dt" : "2",
"predefined" : "Order",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "122",
"id" : "PARENT",
"n" : "Parent",
"vis" : "1",
"dt" : "2",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "177",
"id" : "CODE",
"n" : "Code",
"vis" : "1",
"dt" : "1",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "178",
"id" : "ADDITIONAL",
"n" : "Additional value",
"vis" : "1",
"dt" : "3",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
}
]
},
"ident" : "1",
"name" : "0",
"order" : "2",
"orders" :
{
"its" :
{
"it" :
[
{
"attr" :
{
"k" : "119",
"id" : "ORDER"
},
"reverseOrder" : "0"
}
]
}
}
},
"deduplicateCondition" : "None",
"deduplicateExpression" : "",
"hideInaccessibleElements" : "1",
"reverseOrder" : "0"
}
}
}
public static SetDmStdResult ChangeStandartDimension(DmId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetDmStd()
{
tArg = new SetDmStdArg()
{
pattern = new DmStdMdPattern()
{
attrs = ListOperation.Add
},
meta = new DmStdMd()
{
attrs = new DmStdAttrs()
{
its = new DmStdAttr[]
{
new DmStdAttr()
{
id = "ADDITIONAL",
n = "Additional value",
dt = 3, //DbDataType.Float
k = uint.MaxValue
}
}
}
},
metaGet = new DmStdMdPattern()
{
attrs = ListOperation.Get
}
},
tDim = moniker
};
//Change table dictionary
var result = somClient.SetDmStd(tSet);
return result;
}
See also: