web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Grid multiselect not looping

(0) ShareShare
ReportReport
Posted on by 87

Hello,

I am using a multiselecthelper to iterate through a selected records in a grid. The problem i have is that it works when i actively multi select the records (blue color) but it doesnt work when i click directly on the "all" checkbox. It results on all the records selected (grey color). I can put some code but to be honest the multi select part is quite generic.

For some reason the grid is not catching all the records if i don't click on it.  Is there any known bug?, some property maybe? I compared to other standard forms and i don't see the difference.

Thanks in advance.

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at
  • GirishS Profile Picture
    27,827 Moderator on at

    Hi Eisenberk,

    Can you explain with the screenshot of the form?

    Also, can you paste the code for multiselect helper?

    Thanks,

    Girish S.

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    I checked multiselect helper doesn't loop if you select all records in the grid. I think this is the standard behavior.

    If you want that to work use DataSource getFirst and getNext method instead of Multiselect helper class.

    TableName tableName;
    
    tableName = DatasourceName_ds.getFirst(true);
    while(tableName)
    {
        //do some logic here.
        DatasourceName_ds.getNext();
    }

    Thanks,

    Girish S,

  • Eisenberk Profile Picture
    87 on at

    Hello, thanks for the answers.

    I tried all your contributions without success. I think the problem is related to the grid properties.

    I currently have a button to the action panel  linked to the grid, with the next code in clicked() method (names are generic)

    MultiselectionHelper    helper = MultiselectionHelper::construct();
    Table                   tmpTable;
    
    
    helper.parmDatasource(Table_DS);
    tmpTable = helper.getFirst();
    
    while(tmpTable)
    {
        //Some Logic
        tmpTable = helper.getNext();
    }

    I must say, the loop works when the selected records in the grid are highlited in blue color but for some reason when i click the "select all tick"  it only gets the first record even with all the records selected (highlited in grey color) .

    I am not sure is the standard behaviour because the "RetailAddItems" form works fine.

    Regards.

  • GirishS Profile Picture
    27,827 Moderator on at

    I am not sure its related to the grid properties. Have you compare the grid properties with RetailAddItems and your form.

    I also tested with multiselect helper class its not looping when we select all the records.

    But the code I have pasted is looping even though if you select all the records.

    Thanks,

    Girish S.

  • Eisenberk Profile Picture
    87 on at

    Hello GirishS,

    Yes, I compared the forms and i don't see the difference. The problem (in my case) on looping all the datasource is that sometimes there are records in the datasource that i don't want to use in the loop, thats why i was trying to use the multiselect helper, this way i can multiselect some items, not all.

  • GirishS Profile Picture
    27,827 Moderator on at

    Oh - I guess it's a standard behavior of multiselect helper class - I also tested with multiselect helper class and it's not looping the record if I select all the records.

    Thanks,

    Girish S.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans