Announcements
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.
Hi Hassn i'm facing the same problem did you find a solution ?
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.
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.
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.
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)
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.
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.
Hi Hassan,
You mentioned On-Hand form. Have you checked already InventDimCtrl_Frm_Onhand* classes and how grouping is implemented there?
André Arnaud de Cal...
293,302
Super User 2025 Season 1
Martin Dráb
232,114
Most Valuable Professional
nmaenpaa
101,156
Moderator