Monday, September 4, 2023

How to select\unselect all records in a form grid in Dynamics 365 Finance and Operations

While adding standard command button you can opt for SelectAll to mark all records in a form grid. However, there is no such a command for the opposite - unselect all records.


You can easily achieve it by using the following method and two usual button form controls.


[Form]

public class mgcDeleteForm extends FormRun

{

    public void selectAll(boolean _select)

    {

        VendPaymFormat_DS.markAllLoadedRecords(_select);

    }

 

    [Control("Button")]

    class FormButtonControlSelectAll

    {

        public void clicked()

        {

            element.selectAll(true);

            super();

        }

    }

 

    [Control("Button")]

    class FormButtonControlUnSelectAll

    {

        public void clicked()

        {

            element.selectAll(false);

            super();

        }

    }

}


 


No comments:

Post a Comment