HI
I want to get values of first column of AX form Grid selected (checked box) rows.
in my scenario if a user click multiple checkbox of grid on transfer order form i want to get transfer id that is checked by user behind the button click i want all select transfer Ids as show in below picture.
Thanks for your good help and opinion
Hi MAKD,
To get selected record(s) in a grid , you can use MultiSelectionHelper class, then use tablename.fieldname.
An example:
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct(); Set selectedRecords = new Set(Types::Record); MyTable myTable; super(); selectionHelper.parmDataSource(MyTable_DS); myTable = selectionHelper.getFirst(); if (myTable.RecId) { while (myTable) { selectedRecords.add(myTable); info(strFmt("Selected record is %1",myTable.myField));//Display selected record myTable = selectionHelper.getNext(); } }
Use MultiSelectionHelper class to iterate all selected records. Then you can collect all field values that you need, one record at a time.
You can collect all records to a Set object (set of Types::Record) or just Transfer IDs (set of Types::String).
Search the web for AX MultiSelectionHelper and Collection classes / Set class to learn more.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,802 Super User 2024 Season 2
Martin Dráb 229,133 Most Valuable Professional
nmaenpaa 101,154