Microsoft Dynamics AX 2012 R2 – Developer perspective on the Selection list

Microsoft Dynamics AX 2012 R2 – Developer perspective on the Selection list

Extending the Selection list to other list pages

In a previous blog titled Microsoft Dynamics AX 2012 R2 – Selection List, I described how this simple feature can help you keep and manipulate a persistent selection on list pages for planned orders and production orders. In that blog I also mentioned that you can extend other list pages so that they can also use the Selection list feature. In this blog, I’ll provide developers with the specifics of just how to do that. I’ll also describe the foundation beneath the implementation of the Selection list.
During implementation, the conceptual name of this feature was Production Record Basket. This name became the ProdRecBasket prefix, which is assigned to the elements of the feature and will help us to locate the artifacts in the system that we’ll need for the extension.

 
Figure 1: The artifacts related to the Selection List

 

The Selection list is implemented in a context-agnostic manner. The feature recognizes only that records from the root data are displayed in the grid, and is neither domain specific nor dependent on the type of records it displays. One important note is that the Selection list works only with the source of the root data for the list page. The root data source for a form is easy to identify. It’s the one data source that has the Joins property clear and usually appears first on the list of data sources.

For this exercise, the most relevant artifacts to keep in mind are the following:

  1. The ProdRecBasket configuration key
    1. You must enable this configuration key to use the feature because it controls access to the table definitions and menu items.
  2. The Selection list button group
    1. These are buttons that need to add to the Action Pane of the list page that are the front-end UI for this feature.
      Their functions are detailed in the previous post. I recommend using the form ReqTransPOListPage as a data point to retrieve these.


      Figure 2: The Selection list buttons, as implemented in the ReqTransPOListPage form.

  3. The ProdRecBasketPart (the Selection List Factbox part)

    1. This is the form part to attach to the list page. It functions as the engine that
      supports the feature.

  4. The ProdRecBasketUse (the security privilege)

    1. This security privilege enables the user roles to read and write to the tables.

Using these four elements I’ll go through the process of extending another list page so that it consumes the Selection list.
For this example, I’ll use the EcoResProductListPage form.

My first concern is security. I must ensure that the user role can read and write to the selection list tables. I’ll start by locating the duties that are related to the Products form, which are EcoResProductDefinitionMasterInquire and EcoResProductDefinitionMasterMaintain. To these duties I’ll then add a reference to the privilege called ProdRecBasketUse.



Figure 3: Extending the duties for the Products list page to be able to use the Selection List.

Now that I’ve taken care of security, my next step is to add the buttons to the EcoResProductsListPage form. I’ll use the ReqTransPOListPage as the source of the metadata information. I’ll copy the button group from the planned orders list page, and paste it on the Action Pane of the Products list page. When you do this, please remember to change the metadata property called
DataSource to match the root data source of the form. In this case, the root data source of the Products form is called EcoResProduct.



Figure 4: Adding the selection list buttons to the Products list page.

The last step is to add the controlling fact box to the Products list page. I’ve just created it, but I also could have copied it from the Planned orders list page. Now that it’s added, I’ll align the metadata properties as shown in Figure 5.


Figure 5: Adding the Selection list part to the Products list page.

When the process is done, my Products list page should be ready for the Selection list.



Figure 6: The Products list page extended to support the selection list

Please make sure to add a comment or send me a message with any questions or concerns regarding this topic.

 

Andre Lamego,
reviewed by Brent Holtorf and Roxana Christina Diaconu

Microsoft Dynamics AX R&D

 

 

 

Microsoft Dynamics AX 2012 R2 – Selection List

Microsoft Dynamics AX 2012 R2 – Selection List     

A feature that enables persistent selections on list pages

In earlier versions of Microsoft Dynamics AX, the paging, selection methods, and actions that were available on list pages varied across the different areas of the product. For example, some list pages let you select only one line at a time in the grid while others allowed multiple selections. Some list pages had a Mark column with check boxes, which were handled by background code on the forms, while others would not let you mark rows in the list.


Figure 1: On the left: custom row marking. On the right: kernel-managed (standard) row marking

Microsoft Dynamics AX 2012 brought consistency to the selection behaviors. The kernel now manages row selections, and the overall selection experience is aligned with other Microsoft products such as Excel, as shown in Figure 2.

Figure 2: Row selection in Microsoft Excel 2013 

 

The new kernel behavior has replaced prior methods. Some of the requirements that were addressed in earlier versions were not compatible with the new mechanics and have been removed. One of these requirements is the ability mark a record independently of the row selection. For example, a collection of records could be marked while others would be selected. This scenario is no longer possible.
Some customers expressed concerns that the new behavior would prevent them from selecting some records while investigating the details of others. For example, for a production planner it’s important to be able to mark the production orders that he or she expects to firm (at the same time) while looking at the details of other orders to determine whether to firm them as well. According to the new behavior, the planner’s selections are cleared when a second record is selected or the details form is opened.
We’ve worked closely with these customers, and in the Microsoft Dynamics AX 2012 R2 release we’ve delivered a solution that adheres to the standard selection experience and enables this scenario.
The feature is called the Selection list, and it’s available on the Action Pane.

Figure 3: Selection list-enabled Production Order list page in Dynamics AX 2012 R2

The Selection list feature is not enabled by default. To use the feature, you must enable the Selection list usage configuration key for the Production series I license key. The Selection list is then available on the list pages for planned orders and production orders.

Figure 4: The Selection list configuration key

The Selection list is similar to the Task list in Microsoft Outlook. You can select a group of records on the list page and add them to the Selection list. You can query the records, and you can also filter the records on the list page to match the list, or show only those records that are not in the list. This gives you better control of the amount of information that is displayed.

Figure 5: The Selection list Action Pane Group

The following functions are available:

  • Add to selection
    • Adds the selected record(s) from the list page to the Selection list.
  • Remove from selection
    • Removes the selected record(s) from the Selection list.
  • Clear selection
    • Clears all records from the Selection list.
  • View selection
    • Applies a view to the contents of the list page that shows only records that are included in the Selection list. The view is applied until you click the button again.

      Left: View is on. Right: View is off.
  • View unselected
    • Applies a view to the contents of the list page that shows only records that are not included in the Selection list. The view is applied until you click the button again.

      Left: View is on. Right: View is off.

The Selection list feature also includes the Selection list FactBox, which is available to the right of the list. The Selection list FactBox displays all of the records that have been added to the Selection list. Additionally, you can also use the FactBox to apply the View selection view.


Figure 6: The Selection List fact box

The Selection list remains available when you close and reopen the client. The selections in the list are saved for a user in the context of one legal entity.
A separate blog post will show how partners can consume and extend the Selection list for use on other list pages. Many other list pages can be customized to take advantage of this feature.

Andre Lamego,
reviewed by Brent Holtorf and Roxana Christina Diaconu

Microsoft Dynamics AX R&D