This post shows the code for extracting Financial Dimension value by providing dimension name for each dimension combination which is created and persisted.
The DimensionAttributeValueCombination table contains information about accounts and various dimensions combinations that are used. However, they are stored as a combination ex: (100010-AX-00001- – – -). These values are retrieved through DimensionAttributeValueSetStorage storage class. This class can be used to manipulate these combinations.
The job below helps you in finding out the required values.
In order to fetch Value and Description use the following query
The DimensionAttributeValueCombination table contains information about accounts and various dimensions combinations that are used. However, they are stored as a combination ex: (100010-AX-00001- – – -). These values are retrieved through DimensionAttributeValueSetStorage storage class. This class can be used to manipulate these combinations.
The job below helps you in finding out the required values.
static void AI_GetProjectCostCenterValue(Args _args)
{
ProjTable projTable;
DimensionAttributeValueSetStorage dimStorage;
str dimValue;
projTable = projTable::find('000409');
dimStorage = DimensionAttributeValueSetStorage::find
projTable.DefaultDimension);
info(strFmt('Project 000409, Cost Center value : %1', dimStorage.getDisplayValueByDimensionAttribute( DimensionAttribute::findByName('CostCenter').RecId)));
}
Output |
Project |
DimensionAttributeValueSet dimensionAttributeValueSet;
DimensionAttributeValueSetItem dimensionAttributeValueSetItem;
DimensionAttributeValue dimensionAttributeValue;
DimensionAttribute dimensionAttribute;
DimensionFinancialTag dimensionFinancialTag;
ProjTable projTable;
while select RecId from projTable
join RecId from dimensionAttributeValueSet
where dimensionAttributeValueSet.RecId == projTable.DefaultDimension
&& projTable.ProjId == this.ProjId
join RecId from dimensionAttributeValueSetItem
where dimensionAttributeValueSetItem.DimensionAttributeValueSet == dimensionAttributeValueSet.RecId
join RecId from dimensionAttributeValue
where dimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue
join RecId from dimensionAttribute
where dimensionAttributeValue.DimensionAttribute == dimensionAttribute.RecId
//&& dimensionAttribute.Name == 'A_Managing_Group' //Un Comment to get specific value of Financial Dimension
//&& dimensionAttribute.Name == 'A_Managing_Group' //Un Comment to get specific value of Financial Dimension
join Description from dimensionFinancialTag
where dimensionFinancialTag.RecId == dimensionAttributeValue.EntityInstance
{
info(strfmt('%1', dimensionFinancialTag.Description));
}