Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to get selected ro...
Finance forum
Answered

How to get selected rows from grid in D365?

Posted on by 920

Hi , 

I want to get the selected rows from grid control, 

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: How to get selected rows from grid in D365?

    HI Basma,

    Have you added reference package Application Common?

    3302.PNG

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to get selected rows from grid in D365?

    HI,

    I used it , but I get this message :

    "The name 'MultiSelectionHelper' does not denote a class, a table, or an extended data type".

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: How to get selected rows from grid in D365?

    Hi Basma,

    Use MultiSelectionHelper class to iterate all selected records.

    Example code:

    MultiSelectionHelper          selectionHelper = MultiSelectionHelper::construct();
    Set                           selectedRecords = new Set(Types::Record);
    MyTable                       myTable;
    super();
     
    selectionHelper.parmDataSource(MyTable_DS); 
    myTable  = selectionHelper.getFirst(); 
     
    if (myTable.RecId)
    {
        while (myTable)
        {
            selectedRecords.add(myTable);
            info(strFmt("Selected record is %1",myTable.myField));//Display selected record
            myTable = selectionHelper.getNext();
        }
    }

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans