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

Popular posts from this blog

D365F&O - X++ - Best Practice Warning BP Rule: [BPErrorUnknownLabel]: Path:

D365F&O - X++ - How to Enable/Disable button on form based on a condition in D365F&O using Event handlers.

D365FO - X++ - Generate CAR (Customized Analysis Report) report of custom model