Posts Tagged ‘Code Editor’
Ax 2012 Editor improvements
In Microsoft Dynamics AX 2012, a new X++ Editor is introduced which replaces the current legacy editor. The new X++ Editor is based on hosting a Visual Studio 2010 Editor Framework control.
Here are a few Tips & Tricks:
- Type ‘main’ + TAB: The editor generates a standard Main-method.
Note: This trick works with all templates (right-click –> Add-in –> Template) - Type ‘///’ on the top of a method. When you do so you get the standard header for generating XML-documentation.
- While the intellicense drop-down is shown press CTRL. The drop-down dialog becomes transparent.
- CTRL + ‘c’ at the begin of the line will copy the whole line.
- CTRL + ‘i’ and start typing the word that you want to find. If you want the next, just type CTRL + ‘i’ again.
- CTRL + scroll up/down to zoom in and out to the code.
- Make a link to AX32.exe -development to go directly to the development-mode.
You can find more on chanel 9
Create class from code
Did you know that you can build/modify classes from code? It is actually not so hard, just use the ClassBuild-class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | static void JeDoe_testClassBuild(Args _args) { ClassBuild classBuild; ClassNode classNode; Str myCode; ; myCode = @" static void Main(Args _args) { ; info('Hello World!'); } "; classBuild = new ClassBuild("MyTest", false); classBuild.addMethod("Main", myCode); classNode = classBuild.classNode(); classNode.AOTcompile(); classNode.AOTrun(); } |
The sample above will create a new class MyTest with a ‘Hello World’ Main-method and will actually save compile/save the code in the AOT and then run it. Cool?
Note: The SysDictClass/SysDictMethod-class can also help you creating proper classes and methods. Maybe I’ll blog about this later.
Code Editor – shortcuts
Underneed you find the list of shortcuts I use most in Microsoft Dynamics Ax while developing.
- General (shortcuts I also use outside AX)
- CTRL + S : Save.
- CTRL + C : Copy text to clipboard.
- CTRL + X : Cut text to clipboard.
- CTRL + V : Past text from clipboard.
- CTRL + A : Select all.
- CTRL + LEFT / RIGHT ARROW : Next/Previous word.
- CTRL + SHIFT + LEFT / RIGHT ARROW : Select one word to the left/right.
- CTRL + HOME / END : Go to begin/end of the editor.
- SHIFT + HOME / END : Select text from the cursor to the start/end.
- SHIFT + PAGE-UP / PAGE-DOWN : Select the previous/next page. of the line.
- TAB / SHIFT + TAB : Indent Selection / Remove Indent Selection.
- CTRL + BACKSPACE : Remove previous word.
- CTRL + F : Find.
- F3 : Find Next.
- CTRL + Z / Y : Undo / Redo.
- CTRL (+ SHIFT) + TAB : Next/Previous tab-page.
- Ax specific
- Current Line in the Code Editor
- ALT + L : Select current line.
- CTRL + L : Remove current line.
- Breakpoints
- F9 : Insert / Remove breakpoint.
- SHIFT + F9 : Show all breakpoints.
- CTRL +F9 : Enable / Disable breakpoint.
- CTRL + SHIFT + F9 : Remove all breakpoints.
- Compile / Run
- F5 : run / execute current Job / Class / Form
- CTRL + BREAK : Stop execution.
- Lookup / More Info
- CTRL + ALT + SPACE : Lookup label.
- CTRL + SHIFT + SPACE : Lookup definition (go to the method).
- CTRL + SPACE : Show syntax information.
- Current Line in the Code Editor
And there are more shortcuts. You can find them on MSDN.

