Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Group the record on the basis of displayed dimensions

(0) ShareShare
ReportReport
Posted on by 240

I have implemented dynamic inventory dimension display functionality on my custom table, thanks to this article: https://daxbeginners.wordpress.com/2014/08/05/how-to-dynamically-display-inventory-dimension/

But now my form is showing items lines for all the dimensions no matter what dimension is currently displayed. I want the record to be group by ItemId and additionally it should be grouped by the dimension values that are currently being displayed in the form, just like on-hand inventory.

Any idea how to achieve this using InventDimCtrl_Frm_EditDimensions class or any other way.

  • AhmedSaeed Profile Picture
    AhmedSaeed 379 on at
    RE: Group the record on the basis of displayed dimensions

    Hi Hassn i'm facing the same problem did you find a solution ?

  • Hassan Akhtar Khan Profile Picture
    Hassan Akhtar Khan 240 on at
    RE: Group the record on the basis of displayed dimensions

    I have somehow implemented the code by following different classes and forms mostly OnHand*. The lines are grouped fine on the basis of selected dimensions when I first open the form. You can see in the form below it is showing the three dimension columns in which only serial number is different and the totals are breaking into subgroups because of that.
    pastedimage1590681760737v1.png

    But now if I check any new dimension (e.g. Site) and unchecked any existing dimension (e.g. Serial number) from dimension display form and click Ok after Checking the 'Save setup' control it is not updating the grid as expected.

    pastedimage1590682093586v2.png

    As you can see it not fetching the value of Site (here site value is same for all the lines), and also not removing the serial number wise sub-grouping from the grid (just removing the column).

    I think I am missing something here which would update the grid on runtime. If I close the form and open the form again it would fetch the site values and group the lines perfectly as shown in the image below.

    pastedimage1590682673718v3.png

    Can you suggest what code do I need to add to get this result without closing and reopening the form?

    P.S. I have started a new thread for this question as the problem seems a bit different from the original thread. (community.dynamics.com/.../grid-is-not-updating-dynamically-when-selecting-or-deselecting-dimensions-from-dimension-display-form)

  • Suggested answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: Group the record on the basis of displayed dimensions

    Hi Hassan,

    InventDimCtrl_Frm_EditDimensions is just one of the child classes made for a particular case. Usually, if you want to bring displays dimensions you need to create own class inherited from InventDimCtrl_Frm and use it on the form. In this case, you are not dependent on changes made by MS and you don't break anything on other forms if you start modifying it.

    "OnHand" class indeed has a lot of methods and it's quite difficult to analyze it, but there are other simple cases like InventDimCtrl_Frm_Supply (form InventSupply). You need to pay attention to methods rightClickModifyQuery and executeQuery on the form and formSetControlsRightClick and modifyQuery* methods on the class.

  • Hassan Akhtar Khan Profile Picture
    Hassan Akhtar Khan 240 on at
    RE: Group the record on the basis of displayed dimensions

    Yes, I am also looking into InventDimCtrl_Frm_Onhand class code and trying to get the specific grouping related logic from initQuery* and modifyQuery* methods. This class seems to have a lot of other things going on there too and class code is mostly related to On-Hand inquiry and its data sources.

    It seemed like InventDimCtrl_Frm_OnHand.initQueryInventDim() method is doing the job for expanding item lines on the basis of selected dimension values but even though I have commented its calling from init method of InventDim datasource of On-Hand inquiry form, the data is still showing correct apparently with all the groupings of dimension values.

    While looking into the class, I just want to know if there is any code sample available out there to achieve just this grouping functionality generally for custom tables using InventDimCtrl_Frm_EditDimensions.

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: Group the record on the basis of displayed dimensions

    Hi Hassan,

    You mentioned On-Hand form. Have you checked already InventDimCtrl_Frm_Onhand* classes and how grouping is implemented there?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans