// Get Default Dimension value and Names in ax 2012
static void GetDefaultDimensionAttributeName(Args _args)
{
DimensionAttributeValueSetStorage dimStorage;
DimensionAttribute DimensionAttribute;
Counter i;
DimensionAttribute dimAttr;
DimensionAttributeValue dimAttrValue;
Common common;
DictTable dictTable;
str Name;
str value;
dimStorage = DimensionAttributeValueSetStorage::find(5637155830);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
// get attribute select here.
select firstonly dimAttrValue
where dimAttrValue.RecId == dimStorage.getValueByIndex(i)
join dimAttr
where dimAttr.RecId == dimAttrValue.DimensionAttribute
&& dimAttr.Name == "Department";
if (dimAttr && dimAttrValue)
{
dictTable = new DictTable(dimAttr.BackingEntityType);
common = dictTable.makeRecord();
if (common.TableId)
{
select common where common.(dimAttr.KeyAttribute) == dimAttrValue.EntityInstance;
name = common.(dimAttr.NameAttribute);
value = common.(dimAttr.ValueAttribute);
info(dimAttr.Name +"----" +value + "----"+name);
}
}
}
}
static void GetDefaultDimensionAttributeName(Args _args)
{
DimensionAttributeValueSetStorage dimStorage;
DimensionAttribute DimensionAttribute;
Counter i;
DimensionAttribute dimAttr;
DimensionAttributeValue dimAttrValue;
Common common;
DictTable dictTable;
str Name;
str value;
dimStorage = DimensionAttributeValueSetStorage::find(5637155830);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
// get attribute select here.
select firstonly dimAttrValue
where dimAttrValue.RecId == dimStorage.getValueByIndex(i)
join dimAttr
where dimAttr.RecId == dimAttrValue.DimensionAttribute
&& dimAttr.Name == "Department";
if (dimAttr && dimAttrValue)
{
dictTable = new DictTable(dimAttr.BackingEntityType);
common = dictTable.makeRecord();
if (common.TableId)
{
select common where common.(dimAttr.KeyAttribute) == dimAttrValue.EntityInstance;
name = common.(dimAttr.NameAttribute);
value = common.(dimAttr.ValueAttribute);
info(dimAttr.Name +"----" +value + "----"+name);
}
}
}
}
No comments:
Post a Comment