In this example method we pass 2 parameters :
- Ledger dimension record
- An Attribute named “BusinessUnit”. The attribute of which we want to retrieve the value
This methods returns the sigle dimension Attribute value
static DimensionDisplayValue getAttributeValueFromCombination(
DimensionAttributeValueCombination _combination,
Name _attributeName = 'BusinessUnit')
{
DimensionAttributeLevelValueView valueView;
DimensionAttribute attribute = DimensionAttribute::findByName(_attributeName); //Retrive attribute record by Name
select valueView
where valueView.ValueCombinationRecId == _combination.recId
&& valueView.DimensionAttribute == attribute.RecId; //Retrieve individual Dimension attribute record
return valueView.DisplayValue; //Retrive dimension attribute value
}