Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Query DimensionAttribu...
Finance forum

Query DimensionAttributeValueCombination extra fields fields X++

(0) ShareShare
ReportReport
Posted on by 65

Hi I need help to access extra fields in DimensionAttributeValueCombination in X++.

SQL QUERY
56525.PNG

Trying to access it in X++ query.
14027.PNG

AOT DimensionAttributeValueCombination

4137.PNG
Thanks in advance!

  • jerrold-verzosa Profile Picture
    65 on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Yes, found a workaround how to do it. A bit lengthy code but it works. Will update this thread soon. Thanks!

  • Blue Wang Profile Picture
    on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Hi  Jerrold,

    Has your problem been solved?

    If the above reply is helpful, please mark it as verified and make it easy for others to find a solution quickly.

    Thanks.

  • Verified answer
    Pedro Tornich Profile Picture
    955 on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Hi jerrold-verzosa,

    Since dimension values are spread among different tables, getting a specific dimension value may become more complex than it looks like.

    To ease this task Microsoft introduced some useful views.

    In your case, the data you need is in the DisplayValue field of the DimensionAttributeLevelValueView.

    Each ledger dimension value will be a record on this view.

    Imagine, for example, the following ledger dimension: Acc01-Dept02---

    It would be represented by two records on the view, each containing both the DimensionAttributeValueCombination RecId and the DimensionAttribute RecId.

    Best,

    Pedro

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Hi Jerrold,

    Please refer to Andre's reply in this thread.


    [View:https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/265216/how-to-expose-more-columns-in-aot-from-axdb:750:50]

    Microsoft introduced a feature for configuration of custom fields in D365 (Platform update 13). This feature is using technology which enables creating table extensions on runtime. This technology was already used from the initial version of D365. I did understand that Finance areas already used this technology. These fields are possibly created runtime for performance optimalization. As there is a split between development and the application, fields created run time, are not moved back to the development environment.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    294,099 Super User 2025 Season 1 on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Hi Jerrold,

    There are some fields in the database created by Microsoft on runtime. These are not accessible from the development environment. The dimension values in this table is one example. The reason is, because you can setup dimensions, so it is not possible to get setup data in the application object tree.

    You can look for views starting with Dimension... There are some which did simplify the datamodel to get dimension values. You then need to join it with the DimensionAttribute table (dimension setup) to get the value per dimension separated.

  • jerrold-verzosa Profile Picture
    65 on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++
    [quote user="Sangram"

    Hi,

    Can you tell us what are you actually trying to do, where do you need them. there can be the other feasible way to do it.

    Regards,

    Sangram

    [/quote

           I'm trying to get values from DimensionAttributeValueCombination like the CostCenter etc. Used join on BudgetSourceTracking and BudgetSourceTrackingDetail in order for me to access DimensionAttributeValueCombination extra fields.


            Query                                                query = new Query();
            QueryRun qr;
            BudgetSourceTracking                                        budgetSourceTracking;
            BudgetSourceTrackingDetail                                    budgetSourceTrackingDetail;
            DimensionAttributeValueCombination                           dimensionAttributeValueCombination;
            QueryBuildDataSource budgetSourceTrackingDs                  = query.addDataSource(tableNum(BudgetSourceTracking));
    
            QueryBuildDataSource budgetSourceTrackingDetailDs          = budgetSourceTrackingDs.addDataSource(tableNum(BudgetSourceTrackingDetail));
            budgetSourceTrackingDetailDs.addLink(fieldNum(BudgetSourceTracking, RecId), fieldNum(BudgetSourceTrackingDetail, BudgetSourceTracking));
            budgetSourceTrackingDetailDs.addSelectionField(fieldNum(BudgetSourceTrackingDetail,ACCOUNTINGCURRENCYAMOUNT),SelectionField::Sum);
            budgetSourceTrackingDetailDs.relations(false);
            budgetSourceTrackingDetailDs.joinMode(joinmode::InnerJoin);
    
            QueryBuildDataSource dimensionAttributeValueCombinationDs = budgetSourceTrackingDetailDs.addDataSource(tableNum(DimensionAttributeValueCombination));
            dimensionAttributeValueCombinationDs.addLink(fieldNum(BudgetSourceTrackingDetail, BudgetControlLedgerDimension), fieldNum(DimensionAttributeValueCombination, RecId));
            dimensionAttributeValueCombinationDs.addSelectionField(fieldNum(DimensionAttributeValueCombination,DisplayValue));
            dimensionAttributeValueCombinationDs.relations(true);
            dimensionAttributeValueCombinationDs.joinMode(JoinMode::InnerJoin);
    
            budgetSourceTrackingDs.addGroupByField(fieldNum(BudgetSourceTracking, TrackingDate));
            
            dimensionAttributeValueCombinationDs.addGroupByField(fieldNum(DimensionAttributeValueCombination, DisplayValue));
    
            budgetSourceTrackingDs.addRange(FieldNum(BudgetSourceTracking, BudgetModelid)).value(queryValue("FY2016"));
            budgetSourceTrackingDs.addRange(FieldNum(BudgetSourceTracking, Category)).value(queryValue(1));
    
            qr  = new queryrun(query);
            while(qr.next())
            {
                budgetSourceTracking   = qr.get(tablenum(BudgetSourceTracking));
                budgetSourceTrackingDetail = qr.get(tablenum(BudgetSourceTrackingDetail));
                dimensionAttributeValueCombination = qr.get(tableNum(DimensionAttributeValueCombination));
                
                info(strfmt("TrackingDate[%1] - AccountingCurrencyAmount[%2] - DisplayValue[%3]- CostCenter[%4]-Department[%5]",budgetSourceTracking.TrackingDate, budgetSourceTrackingDetail.ACCOUNTINGCURRENCYAMOUNT, dimensionAttributeValueCombination.DisplayValue,dimensionAttributeValueCombination.CostCenter));
            }


    Thanks

  • Sangram Shinde Profile Picture
    2,094 on at
    RE: Query DimensionAttributeValueCombination extra fields fields X++

    Hi,

    Can you tell us what are you actually trying to do, where do you need them. there can be the other feasible way to do it.

    Regards,

    Sangram

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,099 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans