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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Retrieve Data From Financial Dimension Fields

(1) ShareShare
ReportReport
Posted on by 38
I am developing a report that is already working, I need to add 2 new fields and retrieve data from financial dimension. I used this code in the event handler "onInserting" but the data didn't show in the report.
 

   AssetBalancesTmp assetBalancesTmp = sender as AssetBalancesTmp;
   AssetTable assetTable;
        dimensionAttributeValue dimensionAttributeValue;
        DimensionAttributeValueSet DimensionAttributeValueSet;
        dimensionAttributeValueSetItem dimensionAttributeValueSetItem;
        dimensionAttribute dimensionAttribute;
        DefaultDimensionview DefaultDimensionview;



        while select * from assetTable
    where assetTable.AssetId == assetBalancesTmp.AssetId

    join RecId from dimensionAttributeValueSet
        where dimensionAttributeValueSet.RecId == assetTable.DefaultDimension
    join RecId, DisplayValue from dimensionAttributeValueSetItem
        where dimensionAttributeValueSetItem.DimensionAttributeValueSet == dimensionAttributeValueSet.RecId
    join RecId from dimensionAttributeValue
        where dimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue
    join RecId, Name from dimensionAttribute
        where dimensionAttribute.RecId == dimensionAttributeValue.DimensionAttribute

        && (dimensionAttribute.Name == "CostCenter" 
        || dimensionAttribute.Name == "Branch")
        {

            assetBalancesTmp.Branch = DefaultDimensionview.DisplayValue;
            assetBalancesTmp.CostCenter = DefaultDimensionview.DisplayValue;


        }
 

 
I have the same question (0)
  • Gelev Martin Profile Picture
    13 on at
    You can try the following select:
     
    while select DimensionAttributeValue.DISPLAYVALUE
        from DimensionAttributeValue
    join DIMENSIONATTRIBUTE
        where DimensionAttributeValue.DIMENSIONATTRIBUTE = DIMENSIONATTRIBUTE.RECID
    join dimensionAttributeValueSetItem
        where DimensionAttributeValue.RECID = dimensionAttributeValueSetItem.DIMENSIONATTRIBUTEVALUE
    join assetTable
        where dimensionAttributeValueSetItem.DIMENSIONATTRIBUTEVALUESET = assetTable.DEFAULTDIMENSION
        && (DIMENSIONATTRIBUTE.NAME = 'CostCenter' or DIMENSIONATTRIBUTE.NAME = 'Branch'
    {
        assetBalancesTmp.Branch = DimensionAttributeValue.DisplayValue
        assetBalancesTmp.CostCenter = DimensionAttributeValue.DisplayValue
    }
     
     
     
     
  • Verified answer
    AB-24101041-0 Profile Picture
    38 on at
    
           
            DimensionAttributeValueSetStorage dimStorage = DimensionAttributeValueSetStorage::find(assetBook.DefaultDimension);
    
            str costCenterValue = '';
            str branchValue = '';
    
            for (int i = 1; i <= dimStorage.elements(); i++)
            {
                str attributeName = DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name;
                str attributeValue = DimensionAttributeValue::find(dimStorage.getValueByIndex(i)).getValue();
    
    
                if (attributeName == 'CostCenter')
                {
                    costCenterValue = attributeValue;
                }
                else if (attributeName == 'Branch')
                {
                    branchValue = attributeValue;
                }
    
            }
     
     
    Solved!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 426 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 371

#3
Martin Dráb Profile Picture

Martin Dráb 279 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans