Hi Guys,
Here is another code snippet to get Dimension value and name by dimension:
static DimensionValue Ale_getDefaultDimensionValue(DimensionDefault _dimensionDefault , Name _defaultDimensionName)
{
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
Common dimensionValueEntity;
DimensionValue dimValue;
Name dimName;
container dimNameValue;
;
dimAttrValueSet = DimensionAttributeValueSet::find(_dimensionDefault);
while select DimensionAttributeValue from dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
{
dimAttrValue = DimensionAttributeValue::find(dimAttrValueSetItem.DimensionAttributeValue);
dimAttr = DimensionAttribute::find(dimAttrValue.DimensionAttribute);
dimensionValueEntity = DimensionDefaultingControllerBase::findBackingEntityInstance(curext(),dimAttr,dimAttrValue.EntityInstance);
if (dimAttr.Name == _defaultDimensionName)
{
dimNameValue = [dimAttrValue.getValue(), dimAttrValue.getName()];
}
}
return dimNameValue;
}
Here is another code snippet to get Dimension value and name by dimension:
static DimensionValue Ale_getDefaultDimensionValue(DimensionDefault _dimensionDefault , Name _defaultDimensionName)
{
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
Common dimensionValueEntity;
DimensionValue dimValue;
Name dimName;
container dimNameValue;
;
dimAttrValueSet = DimensionAttributeValueSet::find(_dimensionDefault);
while select DimensionAttributeValue from dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
{
dimAttrValue = DimensionAttributeValue::find(dimAttrValueSetItem.DimensionAttributeValue);
dimAttr = DimensionAttribute::find(dimAttrValue.DimensionAttribute);
dimensionValueEntity = DimensionDefaultingControllerBase::findBackingEntityInstance(curext(),dimAttr,dimAttrValue.EntityInstance);
if (dimAttr.Name == _defaultDimensionName)
{
dimNameValue = [dimAttrValue.getValue(), dimAttrValue.getName()];
}
}
return dimNameValue;
}
No comments:
Post a Comment