D365F&O - X++ - Get multiple datasource selected record from Listpage/Grid

1- Open the form designer.

2- Go to datasource whose records you want to select.

3- Expand and right click on methods, select override active method.

public int active()
{
    FormDataSource SalesTable_ds;
    SalesTable      SalesTable;
           
    ret = super();
    SalesTable_ds = this.formRun().dataSource('SalesTable');
    // Get first selected record
    SalesTable = SalesTable_ds.getFirst(1);

    while (SalesTable)
    {    
        // Assign next selected record
        SalesTable = SalesTable_ds.getNext();
    }
}

Comments