AX – D365FO – Loop through selected records of a grid with MultiSelectionHelper class

If a grid has Multselection property enabled you can select more than a record. If you want to programmatically loop through selected record just follow this code using MultiSelectionHelper class void clicked() { InventItemGroup itemGroup; MultiSelectionHelper helper = MultiSelectionHelper::construct(); helper.parmDatasource(InventItemGroup_DS); itemGroup = helper.getFirst(); while (itemGroup.RecId != 0) { info(itemGroup.ItemGroupId); itemGroup = helper.getNext(); } }

D365 / AX – X++ – How to get multiple selected records in control level event handlers

Purpose:The purpose of this document is to show how to get multiple selected records in form control event handlers. Development:First of all create new event handler class HRPayrollPayStatementEventHandler and subscribe to form button OnClicked event handler. /// /// The HRPayrollPayStatementEventHandler class is the event handler class for managing PayrollPayStatement form events ///class HRPayrollPayStatementEventHandler{ /// <summary> … Continua a leggere D365 / AX – X++ – How to get multiple selected records in control level event handlers