web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Translation text of custom financial dimension

Muhammad Yasir Profile Picture Muhammad Yasir 1,023
Hi,

Today i am gonna talk about how to get Translation text of custom financial dimension through X++ code. There is a requirement where i need to show the translated text (Description) of one of custom financial dimension in report.


"ProductGroups" is one of the custom financial dimension enabled in our system. so i need to show it's translated text in a report. here is how i achieve this functionality. 

Code Snippet:

    DefaultDimensionView                       dimensionView;
    DimensionAttribute                             dimensionAttribute,dimAttribute;
    DimensionFinancialTagTranslation    dimensionFinancialTagTranslation;
    DimensionFinancialTag                      dimensionFinancialTag;
    DimensionValue                                  productGroupValue;
     
    select firstOnly DimensionAttributeId, DisplayValue from dimensionView
        where dimensionView.DefaultDimension == AMCaseTable::find("M10000007052").DefaultDimension  //5637252113 -- Dimension Recid associated with this case "M10000007052".
        join RecId from dimensionAttribute
            where dimensionView.Name == dimensionAttribute.Name
            && dimensionView.Name == "ProductGroups"; // To get the translation text of this custom financial dimension only

 dimAttribute   = DimensionAttribute::find(dimensionView.DimensionAttributeId);
dimensionFinancialTag=DimensionFinancialTag::findByFinancialTagCategoryAndValue( dimAttribute.financialTagCategory(), dimensionView.DisplayValue);

    select Description from dimensionFinancialTagTranslation
        where dimensionFinancialTagTranslation.DimensionFinancialTag ==  dimensionFinancialTag.RecId;

    productGroupValue = dimensionFinancialTagTranslation.Description;
   
    info(productGroupValue);


Happy DAXing!


This was originally posted here.

Comments

*This post is locked for comments