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.

  • GirishS Profile Picture
    GirishS 27,821 Moderator on at
    RE: Grid multiselect not looping

    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.

  • Eisenberk Profile Picture
    Eisenberk 87 on at
    RE: Grid multiselect not looping

    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
    GirishS 27,821 Moderator on at
    RE: Grid multiselect not looping

    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
    Eisenberk 87 on at
    RE: Grid multiselect not looping

    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.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Moderator on at
    RE: Grid multiselect not looping

    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,

  • GirishS Profile Picture
    GirishS 27,821 Moderator on at
    RE: Grid multiselect not looping

    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
    DAnny3211 Profile Picture
    DAnny3211 9,274 Moderator on at

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans