Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

How to get the details of the selected records through x++ in D365 FO

Vishals786 Profile Picture Vishals786

 

Sometimes we come across a scenario where we need to get the data from the selected records in a form contained in a grid.

For these kind of scenarios MultiSelectionHelper class has always been useful to achieve the same.


Let us look at an example mentioned below : -


    MultiSelectionHelper          selectionHelper = MultiSelectionHelper::construct();

    Set                                       selectedRecords = new Set(Types::Record);

    ABCTable                            abcTable;

    

    selectionHelper.parmDataSource(ABCTable_DS); 

    abcTable  = selectionHelper.getFirst(); 

 

    if (abcTable.RecId)

    {

        while (abcTable)

        {

            selectedRecords.add(abcTable);

            info(strFmt('Selected record.. %1',abcTable.myField));

            abcTable = selectionHelper.getNext();

        }

    }


        

     ***************Please mentiom your queries if any in the comments area**************


This was originally posted here.

Comments

*This post is locked for comments