Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Form Grid Select All Records

Posted on by 945

I have created a form and when I check the select all box it only selects 20 records or the ones that are loaded in the grid.  Can someone direct me to how i can have it select all records in the datasource instead of the loaded records.

I have tried changing the DS Delay Active = No

I have also tried this dynamicsuser.net/.../311603.aspx

Thanks

Eric

*This post is locked for comments

  • Javi Palomar Profile Picture
    Javi Palomar 5 on at
    RE: Form Grid Select All Records

    A good solution for the purpose you want is to simulate a key press in the code.

    #task

    ;

    element.task(#taskSelectAll);

    Where element is the callerform.

  • Eric Enlow Profile Picture
    Eric Enlow 945 on at
    RE: Form Grid Select All Records

    I ended up switching out my code to mimic this example and now everything is good.

    soft-maya.blogspot.com/.../retrieve-multiple-selected-records-from.html

    Thanks everyone for all the help and responses.

    Eric

  • Eric Enlow Profile Picture
    Eric Enlow 945 on at
    RE: Form Grid Select All Records

    Andre,

    thanks for the response.  My goal is to do this in code and not having the user do anything but click the check box.  At this point its my opinion that the check box doesn't function like one would assume and will work around it until i have a better understanding on how the grid/datasource and the select all(select all that is currently displayed) checkbox works

    Eric

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Form Grid Select All Records

    You can use the key combination Ctrl + Shift + End on a grid. Then AX will ask you to load and select every single record of the datasource.

  • Eric Enlow Profile Picture
    Eric Enlow 945 on at
    RE: Form Grid Select All Records

    Thanks Joris,  

    I took a quick stab at the link mentioned above.  I didnt have any luck.  I am using a staging table and not a system table so i wasnt able to translate the mentioned sample directly to my needs.  That probably due to my lack of experience.  I didnt want to spend a ton of time on this nor continue to bother you with the issues. I have a good work around and will circle back to this so i get a good understanding of how the helper works.

  • Eric Enlow Profile Picture
    Eric Enlow 945 on at
    RE: Form Grid Select All Records

    Daniel,

    Thanks for the response.  I think i will just add a new button that will update datasource using select forUpdate at the table and if the user wants to select specific records they can use the existing button which works fine.  This is a small part of the project so i can always circle back and by that time i will have more experience and have read 2 million more docs.

    Eric

  • Suggested answer
    Daniel Weichsel Profile Picture
    Daniel Weichsel 1,657 on at
    RE: Form Grid Select All Records

    Building on Joris's suggestion of pressing Ctrl+A, I have used a workaround a few times of pressing Ctrl+A then Ctrl+C to copy the grid contents to the clipboard -- the copying is what will actually load the whole data set.  Unfortunately, this puts the burden on the user each time instead of a development fix.

  • Suggested answer
    Joris dG Profile Picture
    Joris dG 17,775 on at
  • Eric Enlow Profile Picture
    Eric Enlow 945 on at
    RE: Form Grid Select All Records

    Joris,

    Thanks for the reply.  Unfortunately it is still only selecting 20 records.  Perhaps its something in the code i wrote that is limiting the records.  

    Once I select all by using CTR+A or the select all check box i am pressing a button which creates an array of the selected records using this line of code.  Unfortunately it is only returning 20 records.  

    myArray = FormDataSource_ds.recordsMarked();

    Then looping though the records using

    FormDataSource_ds.next();

    However if i scroll the grid it will increase depending on how much I scroll.

    Is there a better way to do this?  This is my first time using forms/grids and their datasources and based on what i have read so far this is what i have come up with.

    Thanks for the help

    Eric

  • Suggested answer
    Joris dG Profile Picture
    Joris dG 17,775 on at
    RE: Form Grid Select All Records

    Use the windows shortcut CTRL+A to select all, which on an AX grid will select all records. It will actually force all records to be loaded.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans