Announcements
Hi I need help to access extra fields in DimensionAttributeValueCombination in X++.
SQL QUERY
Trying to access it in X++ query.
AOT DimensionAttributeValueCombination
Thanks in advance!
Yes, found a workaround how to do it. A bit lengthy code but it works. Will update this thread soon. Thanks!
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.
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
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.
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.
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)); }
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
André Arnaud de Cal...
294,099
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator