Get particular Financial dimension value from default dimension in Axapta

To get particular dimension value from default dimension you can try below code as per your requirement.

  DimensionAttributeValueSetItem dimvalue;  
   DimensionAttributeValue dimAttValue;  
   DimensionAttribute dimAtt;  
   int length;  
   //DimAttributeOMCostCenter  viewCostCenter;  
   DimensionFinancialTag    viewCostCenter;  
   DimAttributeOMDepartment  viewDepartment;  
   DimensionFinancialTag    locations;  
   str name;  
   ;  
   length = 0;  
   Select dimvalue  
   join dimAttValue  
   join dimAtt  
   Where dimvalue.DimensionAttributeValueSet == _DimensionDefault  
   && dimvalue.DimensionAttributeValue == dimAttValue.RecId  
   && dimAttValue.DimensionAttribute == dimAtt.RecId  
   && dimAtt.Name == 'ProductCategory';  
   select viewCostCenter  
   where viewCostCenter.Value == dimValue.DisplayValue;  
   return viewCostCenter.Description;  

No comments: