Hello,
Is it possible to check if the user has added any new column to the grid view?
Thanks.
You are right, sorry for the mistake.
You're in a wrong thread - this one is about "checking if the user has added any new column to the grid view". You probably wanted to put it onto your thread .
Hello,
I have a display method created on the InventSum datasoure of the InventOnhandItem form. Based on the debugging I did on this method, _inventSum is "No data selected"
This method calls the myMethod method from the InventSum table extension.
[ExtensionOf(formDataSourceStr(InventOnhandItem, InventSum))] final class InventOnhandItem_InventSum_XXX_Extension { display Qty myDisplay(InventSum _inventSum) { FormDataSource inventSum_ds = _inventSum.datasource(); InventSum inventSum = inventSum_ds.cursor(); FormDataSource inventDim_ds = inventSum_ds.formRun().dataSource("InventDim"); return InventSum.MyMethod(_inventSum, InventDim_ds); } }
[ExtensionOf(tableStr(InventSum))] final class InventSum_XXX_Extension { public Qty myMethod(InventSum _inventSum, FormDataSource _ds) { InventTrans inventTrans; InventDim inventDim; Common common = formJoinedRecord(_inventSum, _ds); if(common.TableId == tableNum(InventDim)) { inventDim = common as InventDim; } if(inventDim.InventLocationId) { return 99; } return 0; } }
The requirement is that the display is to show a value of 99 if the 'Location' storage dimension is enabled and not empty for the row.
I have the same logic in AX12 and there it works without any problem. I'm trying to get it into D365, but with no results.
Could you please help me?
Try iterating child controls of the grid and check if those user controls are there.
for (int i = 1; i <= grid.controlCount(); i ) { var control = grid.controlNum(i); }
If it includes the control you're interested in, you'll just add code checking the particular table/field ID.
I believe I even used it in one customization, but I'm not 100% sure.
Hi, The controls added by personalization are added as 'SysGen_', you can right click on form controls and check the control name. All existing fields by standard will have some meaningful control name.
Also, if you can see Standard View in form then no new column added from UI, If there is any field added by personalization then user has to save the View and publish it if required for other users.
I don't think its possible to check from code if field added via personalization exists in form grid.
I was more thinking of checking if a specific column has been added to the grid view.
I want to add some logic depending on whether the column is visible or not....
From the top of my head and without checking in the application: have you tried by checking the number of columns in the grid? If you know how many columns there are to start with, then you can see if the user has added any columns.
André Arnaud de Cal...
292,031
Super User 2025 Season 1
Martin Dráb
230,868
Most Valuable Professional
nmaenpaa
101,156