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 :
Microsoft Dynamics AX (Archived)

Default dimension attribute value as a field in form grid control

(0) ShareShare
ReportReport
Posted on by 805
Hi All,
Is there any way to display a field part of default dimension to the grid form control without using display method? I can do this through display method but the user cannot do filtering by this field therefore it is not appropriate.
Here is my display method approach:
display public DimensionValue displayDefaultDimCostCenter()
 {
     DimensionAttributeValueset     dimAttrValueSet;
     DimensionAttributeValueSetItem dimAttrValueSetItem;
     DimensionAttributeValue        dimAttrValue;
     DimensionAttribute             dimAttr;
  
     select firstOnly dimAttr
         where dimAttr.Name == "CostCenter";
  
     select dimAttrValueSet
         where dimAttrValueSet.RecId == this.DefaultDimension
         join dimAttrValueSetItem
             where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
             join dimAttrValue
                 where dimAttrValueSetItem.DimensionAttributeValue == dimAttrValue.RecId
                    && dimAttrValue.DimensionAttribute             == dimAttr.RecId;
  
     return dimAttrValueSetItem.DisplayValue;
 }
 
But I would like to add CostCenter default financial dimension to a grid control in my custom form which datasource is SalesTable, so the user can do filtering and sorting the grid control by CostCenter.
Is there any way to do that?
Thank you in dvance.

*This post is locked for comments

I have the same question (0)
  • _MGP Profile Picture
    506 on at
    RE: Default dimension attribute value as a field in form grid control

    I've recently implemented the same sort of thing for the Projects ListPage.

    The only difference is that for the Query I used DefaultDimensionView to join ProjTable on ProjTable.DefaultDimension == DefaultDimensionView.DefaultDimension.

    Also, I got the form to display 2 specific dimensions not just 1.

    I found that I could filter values generally e.g. filter on 1 or more actual dimension values.

    But I had problems with filtering the dimension values as blank (e.g. filter on "")

    Also, when I filtered as not a value e.g. !"MyExcludedValue", then all projects are incorrectly displayed and the dimension value that I was trying to exclude suddenly disappears (from the form).

    I think I must have made some error here but can't see anything obvious.

    Can anyone identify the possible cause / solution?

  • dynamics developer Profile Picture
    2 on at
    RE: Default dimension attribute value as a field in form grid control

    Please see this post it may help

    https://community.dynamics.com/ax/f/33/p/108154/309784.aspx#309784

    Thanks

  • Mariano Gracia Profile Picture
    on at
    RE: Default dimension attribute value as a field in form grid control

    Don't put that new field in your SalesTable as you will have to mantain it (it is not a smart solution). If you want to work with dimensions, you should use views. I have faced the same problem a lot of times. Before we start you'll need to modify DimensionAttributeValueSetItemView, in this view add the DimensionAttribute table in the DimensionAttributeValue datasource (set up relations = true), once you have done it add in the fields node the BackingEntityType field from DimensionAttributeValue table (that you have just add in the view). Now create a new query, name it SalesTableCostCenterDimension, in the first datasource add the SalesTable (add SalesId, DefaultDimension and RecId fields), in the SalesTable datasource add the DimensionAttributeValueSetItemView and the Relation SalesTable.DefaultDimension == DimensionAttributeValueSetItemView.DimensionAttributeValueSet, add a new range and set BackingEntityType = 11764 (is the DimAttributeOMCostCenter), at this point you can create a new view, name it SalesTableCostCenterDimensionView, you can add the SalesId field and DisplayValue (from DimensionAttributeValueSetItemView) wich is the costCenter dimension value as you have filtered those values in the query. Once you have this new view you can verify that each record is a SalesOrder and his CostCenter dimension value, just use it in the salesorder form (remember to use outerjoin property, you may have SalesOrder records without CostCenter)

  • ist Profile Picture
    805 on at
    RE: Default dimension attribute value as a field in form grid control

    Thanks Andre!

    I looked at the LedgerTrialBalanceListPage form. The form data source is a temporay table (LedgerTrialBalnceListPageTmp) which has a field of type DimensionSetSegmentValue - array of 11 elements. During the temporaray table population one of all alements is filled with the selected financial dimension.

    This logic couldn't be applied in my form because my data source is not a temporary table (it is SalesTable). I could make a new field of type DimensionSetSegmentValue in SalesTable, but I should make a logic to fill in this field when the sales order header is created or logic to fill in after the data has been fetched and before being displayed on the screen.

    Kind Regards,

    ist.

  • Martin Dráb Profile Picture
    235,966 Most Valuable Professional on at
    RE: Default dimension attribute value as a field in form grid control

    You can't use display methods for filtering. You would have to use joined data sources.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    297,611 Super User 2025 Season 2 on at
    RE: Default dimension attribute value as a field in form grid control

    Hi Ist,

    Have a look at the Trial balance form in General Ledger. Here you can select if you want to show the dimensions in separate columns. You can see whether this logic could be applied in your form.

    Note that using the advanced query form (Ctrl+F3) you can do filtering on dimensions.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans