Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

Multiselect Row On Grid and get first column values

Posted on by 102

HI

I want to get values of first column of AX form Grid selected (checked box) rows.

in my scenario if a user click multiple checkbox of grid on transfer order form i want to get transfer id that is checked by user behind the button click i want all select transfer Ids as show in below picture.

pastedimage1588780417151v1.png

  • MAKDAX2012_Ahmed Profile Picture
    MAKDAX2012_Ahmed 102 on at
    RE: Multiselect Row On Grid and get first column values

    Thanks for your good help and opinion

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: Multiselect Row On Grid and get first column values

    Hi MAKD,

    To get selected record(s) in a grid , you can use MultiSelectionHelper class, then use tablename.fieldname.

    An example:

    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();
        }
    }

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,154 on at
    RE: Multiselect Row On Grid and get first column values

    Use MultiSelectionHelper class to iterate all selected records. Then you can collect all field values that you need, one record at a time.

    You can collect all records to a Set object (set of Types::Record) or just Transfer IDs (set of Types::String).

    Search the web for AX MultiSelectionHelper and Collection classes / Set class to learn more.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans