пятница, 18 мая 2018 г.

Check how many rows were selected on the form grid

Hi!

This approach is common for either DAX 2012 or D365FO.

If you need to check how many rows were selected by the user, you just need to get the formDataSource value before, for example

FormDatasource fds = _args.record().datasource();

And then write next code:
if (fds.recordsMarked().lastIndex() > 1)
{
    info("more than 1 record was selected");
}  

Hope, this information will be useful for someone as for me.