In my practice, I was asked a number of times to create various application functions that process user-selected records in a form grid. Regardless of what function is being created, the first step was always to determine what records were selected by the user.
In this recipe, we explore several ways of achieving this goal. We will modify the Items form in the Inventory management module by adding a new button to it, which lists currently selected records in the overview grid.
In AOT, open the InventTable form and create a new method with the following code:
void processSelectedItems() { InventTable inventTableLocal; ; for (inventTableLocal = InventTable_ds.getFirst(true) ? InventTable_ds.getFirst(true) : InventTable; inventTableLocal; inventTableLocal = InventTable_ds.getNext()) { info(strfmt( "You've selected item '%1'", inventTableLocal.ItemId...