1. static void getsingleDimensionValue(Args _args)
{
SalesTable salesTable = SalesTable::find("DAT-000002");
Name _dimensionName = "Department";
DimensionAttributeValueSetStorage dimStorage;
str dimValue;
Counter counter;
;
dimStorage = DimensionAttributeValueSetStorage::find(salesTable.DefaultDimension);
for (Counter=1 ; Counter<= dimStorage.elements() ; Counter++)
{
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(Counter)).Name == _dimensionName)
{
dimValue = dimStorage.getDisplayValueByIndex(Counter);
info(dimValue);
}
}
}
2. DimensionValue getDimensionValue(RefRecID dimensionSetRecID,Name attributeName)
{
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttribute;
dimAttrValueSet = DimensionAttributeValueSet::find(dimensionSetRecID);
select dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
join dimAttrValue
where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue
join dimAttribute
where dimAttribute.RecId == dimAttrValue.DimensionAttribute
&& dimAttribute.Name == attributeName;
return dimAttrValue.getValue();
}
{
SalesTable salesTable = SalesTable::find("DAT-000002");
Name _dimensionName = "Department";
DimensionAttributeValueSetStorage dimStorage;
str dimValue;
Counter counter;
;
dimStorage = DimensionAttributeValueSetStorage::find(salesTable.DefaultDimension);
for (Counter=1 ; Counter<= dimStorage.elements() ; Counter++)
{
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(Counter)).Name == _dimensionName)
{
dimValue = dimStorage.getDisplayValueByIndex(Counter);
info(dimValue);
}
}
}
2. DimensionValue getDimensionValue(RefRecID dimensionSetRecID,Name attributeName)
{
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttribute;
dimAttrValueSet = DimensionAttributeValueSet::find(dimensionSetRecID);
select dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
join dimAttrValue
where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue
join dimAttribute
where dimAttribute.RecId == dimAttrValue.DimensionAttribute
&& dimAttribute.Name == attributeName;
return dimAttrValue.getValue();
}
No comments:
Post a Comment