Skip to main content

Posts

Showing posts from May, 2014

Dynamics ax 2012 traversing selected records in a form data source

A classical developer challenge in Dynamics AX is to enable a form button when multiple records have been selected in the form by the user. This usually involves writing some form of loop (for or while or do-while) that starts out with calling _ds.getFirst() and continuing the loop as long as _ds.getNext() returns a tablebuffer. Well things got a little bit easier in AX 2012. In AX 2012 you can use the MultiSelectionHelper class. One example is the following that I encountered in AX 2012: Can you make the customer collection letter print out run for each selected collection record in the Print/Post collection letters form (Accounts receiveable / Periodic / Collections / Print/Post Collection letters). If we ignore the possibility for setting up print destination for running each report we can do this in two steps: 1) Change the "Multiselect" property of the "MenuButton" and the "Menuitembutton" in the MenuButton in the form from "Auto&quo