AddThis
Monday, March 27, 2017
Wednesday, March 22, 2017
Multi-select on form datasource grid in AX
There is a difference in iterating the selected records on a form datasource depending on how and what the user has selected.
Suppose we have a form with Grid multi select property = TRUE. The form has button with it clicked method overwritten.
There are three ways to get selected records:
https://msdn.microsoft.com/en-us/library/cc639186.aspx
Here is some sample code:
Suppose we have a form with Grid multi select property = TRUE. The form has button with it clicked method overwritten.
There are three ways to get selected records:
1. Iterating marked records on the grid
Here is some sample code:
void clicked()
{
InventItemGroup itemGroup;
itemGroup = InventItemGroup_DS.getFirst(1);
while (itemGroup.RecId != 0)
{
info(itemGroup.ItemGroupId);
itemGroup = InventItemGroup_DS.getNext();
}
}
2. Getting the current record by just accessing the datasource directly
Here is some sample code:
void clicked()
{
info(InventItemGroup.ItemGroupId);
}
3. Using MultiSelectionHelper class
The MultiSelectionHelper class provides an interface to work with multiple selected records on a form data source.https://msdn.microsoft.com/en-us/library/cc639186.aspx
Here is some sample code:
void clicked()
{
InventItemGroup itemGroup;
MultiSelectionHelper helper = MultiSelectionHelper::construct();
helper.parmDatasource(InventItemGroup_DS);
itemGroup = helper.getFirst();
while (itemGroup.RecId != 0)
{
info(itemGroup.ItemGroupId);
itemGroup = helper.getNext();
}
}
Friday, February 24, 2017
Pattern: Unit Of Work
Useful links:
https://blogs.msdn.microsoft.com/saviofigueiredo/2014/01/28/ax-2012-unitofwork-performance-series-part-5/
http://dynamics-ax.blogspot.com.by/2011/07/microsoft-dynamics-ax-2012-unitofwork.html
http://axdaily.blogspot.com.by/2011/05/unit-of-work.html
http://codingchamp.blogspot.com.by/2012/12/unit-of-work-framework-in-microsoft.html
https://blogs.msdn.microsoft.com/saviofigueiredo/2014/01/28/ax-2012-unitofwork-performance-series-part-5/
http://dynamics-ax.blogspot.com.by/2011/07/microsoft-dynamics-ax-2012-unitofwork.html
http://axdaily.blogspot.com.by/2011/05/unit-of-work.html
http://codingchamp.blogspot.com.by/2012/12/unit-of-work-framework-in-microsoft.html
Saturday, February 18, 2017
Shortcut keys AX 2012
Code Editor
Action
|
Shortcut
|
Description
|
|---|---|---|
Show the Help window
|
F1
|
Opens context-sensitive Help for the type or
method currently selected in the editor.
|
| Go to the next error message | F4 | Opens the editor and positions the cursor at the next compilation error, based on the contents of the Compiler Output window. |
| Execute the current element | F5 | Starts the current form, job, or class. |
| Compile | F7 | Compiles the current method. |
| Toggle a breakpoint | F9 | Sets or removes a breakpoint. |
| Run an editor script | Alt+R | Lists all available editor scripts and lets you select one to execute (such as Send To Mail Recipient). |
| Open the Label editor | Ctrl+Alt+Spacebar | Opens the Label editor and searches for the selected text. |
| Go to implementation (drill down in code) |
F12 | Goes to the implementation of the selected method. This shortcut is highly useful for fast navigation. |
| Go to the next method | Ctrl+Tab | Sets the focus on the next method in the editor. |
| Go to the previous method | Ctrl+Shift+Tab | Sets the focus on the previous method in the editor. |
| Enable block selection | Alt+<mouse select> or Alt+Shift+arrow keys |
Selects a block of code. Select the code you want by pressing the Alt key while selecting text with the mouse. Alternatively, hold down Alt and Shift while moving the cursor with the arrow keys. |
| Cancel selection | Esc | Cancels the current selection. |
| Delete current selection/line | Ctrl+X | Deletes the current selection or, if nothing is selected, the current line. |
| Incremental search | Ctrl+I | Starts an incremental search, which marks the first occurrence of the search text as you type it. Pressing Ctrl+I again moves to the next occurrence, and Ctrl+Shift+I moves to the previous occurrence. |
| Insert XML document header | /// | Inserts an XML comment header when you type ///. When done in front of a class or method header, this shortcut prepopulates the XML document with template information relevant to the class or method. |
| Execute editor script | <name of script>+Tab | Runs an editor script when you type the name of an editor script on an empty line in the editor and press Enter. Script names are case sensitive. |
| Comment selection | Ctrl+E, C | Inserts comment marking for the current selection. |
| Uncomment selection | Ctrl+E, U | Removes comment marking for the current selection. |
Breakpoints
Command
|
Shortcut key
|
|---|---|
Remove all breakpoints.
|
CTRL+SHIFT+F9
|
Insert or remove a breakpoint.
|
F9
|
Enable or disable a breakpoint.
|
CTRL+F9
|
Open the Breakpoints dialog.
|
SHIFT+F9
|
Subscribe to:
Comments (Atom)