Multiselection Design Pattern [AX 2012]
Updated: October 26, 2012
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Buttons and their underlying menu items must support multiselection in grids to the greatest possible extent. This programming pattern can be used to make functionality multiselection-enabled.
The following code example shows items that could be found on a form with the xRefReferences data source.
void clicked()
{
xRefReferences xRefReferencesEdit;
;
// Are there any marked records?
for (xRefReferencesEdit = xRefReferences_ds.getFirst(1)
? xRefReferences_ds.getFirst(1)
// If yes, get the first marked record,
// otherwise, use the current record.
: xRefReferences;
// Continue as long as there are records to work on.
xRefReferencesEdit;
// Get the potential next marked record.
xRefReferencesEdit = xRefReferences_ds.getNext())
{
// Do processing with xRefReferencesEdit.
...
}
}
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.
Community Additions
ADD
Show: