Code highlighting

Showing posts with label hotkeys. Show all posts
Showing posts with label hotkeys. Show all posts

Tuesday, September 27, 2016

Development tools: Editor scripts in Microsoft Dynamics AX 7 or Visual Studio X++ code snippet library

As you know from some of my previous post, I'm a bit fan of developer productivity. Over the years I've delved into creating new Editor Scripts in Axapta, some of the more complex ones shown below:

http://kashperuk.blogspot.dk/2008/08/another-useful-editor-script-for.html
http://kashperuk.blogspot.dk/2010/01/editor-script-for-simplifying-search-in.html
http://kashperuk.blogspot.dk/2008/05/editorscriptsaddinsopeninaot-version-2.html

That's why I was very happy to read a blog post by Martin Drab aka goshoom the other day. Martin describes the use and the simple steps to create new code snippets for Visual Studio that apply to X++ language. Here it is: http://dev.goshoom.net/en/2016/06/custom-code-snippets/

Now, as you can see from the blog post, it's not exactly the same in terms of capabilities as the Editor Scripts in AX 2012 and prior. The code snippets in VS are specifically targeted at inserting some new code into the editor or refactoring existing code in the editor, but not interacting with AOT and AX metadata.

They are however still quite handy, especially if you get used to the hotkey combination Ctrl+K, Ctrl+X (or S for surrounding your code with whatever the snipped inserts).

That's why I decided to create a public code snippet library through which we could potentially share some useful code snippets with each other.

To start it off I have ported some of the more commonly used template editor scripts from AX 2012.

Here is the link to the Visual Studio X++ code snippet library.

Share your cool code snippets here in the comments, and I will upload them to the share (just to have some moderation process in there)

If you have some comments or suggestions as to a better place to store these, let me know through the comments below.

Thanks!

Thursday, July 10, 2008

Microsoft Dynamics AX 2009 Keyboard shortcuts

A whole lot of new and handy shortcuts have been introduced in Microsoft Dynamics AX 2009. To name just a few, that are very important for developers:
Ctrl+Shift+P opens the Projects
Ctrl+Shift+I (from AOT or projects) opens the import project window, etc.
Alt+F1 will return you to the main Dynamics AX window (especially useful for those fond of Tabax)

A fellow tester from Dynamics AX Client team, David Kidder, created a document containing the shortcuts available, grouping them according to where they are used in the application.

One thing I would like to highlight is that you don't need to work for Microsoft to create this list. You can get the list of all available shortcuts in the system by launching the client (Ax32.exe) with the -internal=GENERATEKEYHELP command line argument. The xml file with the shortcuts, AxKeyDump.xml, will be placed into the Client\Bin folder of Dynamics AX.

It is an extremely useful document, and I suggest everyone prints it out and hangs it by their desk.
The download link can be found below:
AX 2009 Keyboard Shortcuts.docx

Warning: The file is in Microsoft Word 2007 format, but I am sure all of you have that (or the converter) by now.

UPD: Also check out the cool looking poster with shortcut keys for end users to hang by their desk.

Saturday, March 08, 2008

Hotkeys and Find vs Filter in Dynamics AX 2009

In Microsoft Dynamics AX 2009 a number of changes regarding Filtering in grids were introduced. I would like to talk about one of them today.

As most of you know, in AX 4.0 the Ctrl+F hotkey was replaced with Ctrl+K, which was very confusing for customers that were using AX 3.0 at the time. (see one of my previous posts with a .dll go fix that)

Well, I am happy to tell you, that Ctrl+F is now back as a regular (not Global) Find option in AX 2009. But Ctrl+K is also available. So it was decided, that having to identical commands is not really smart. So now they actually perform different actions.

Ctrl+F is Find
Ctrl+K is Filter = Filter by Field from the context menu on the grid line.

Now, you might wonder what the difference is. I will explain it on an example:

You have a grid with items of different Item Type (BOM, Item, Service) and different Item Group (Parts, Bulbs, etc.)

Scenario 1: (Notice the dialog caption is Filter)
1. Press Ctrl+K on Item Type "BOM"
2. Press OK (the value BOM is already inserted in the search field).
3. Only BOM items are shown
4. Press Ctrl+K on Item Group "Parts"
5. Press OK (the value Parts is already inserted in the search field).
6. Now only BOM items with Item Group = Parts are shown.

Scenario 2: (Notice the dialog caption is Find)
1. Press Ctrl+F on Item Type "BOM"
2. Input "BOM" and press OK (you have to input the value you are searching for every time).
3. Only BOM items are shown
4. Press Ctrl+F on Item Group "Parts"
5. Input "Parts" and press OK.
6. Now only items with Item Group = Parts are shown, including both BOM and other Item types.
So, basically, all previous filtering on the grid was removed before applying the new search criteria.

As a side note, I would also like to mention, that some changes were made to hotkeys in the Editor: Now, Editor Scripts are opened using Alt+R hotkey, instead of Alt+M, as in previous AX versions. (Alt+M was reserved for the global menu toolbar, which is one of the new features in AX 2009 as well)