AxAssist’s AOT status bar provides additional information:
Methods definition for classes
Corresponding caption for other AOT elements (like tables, table fields, forms, forms design elements).
AxAssist’s AOT toolbar
AxAssist’s AOT toolbar provides quick access to the following functions:
Opening the current table (highlighted) in the Table Browser form.
Opening subelement that is corresponding to the current opened (highlighted) one in the new window.
Opening parent class of currently highlighted class.
Opening EDT or enum which was used to create current highlighted field.
Opening form “Compare” for the current element.
Opening active form in AOT.
All functions of AxAssist’s AOT toolbar are duplicated in the AxAssist’s Main toolbar.
Axapta Editor
Variables list
When you type code in Axapta Editor, AxAssist analyzes it and offers list of suggestions. The list contains all available (defined) variables for current recognized element (class variables, datasources and corresponding tables, controls with property AutoDeclaration set to “Yes”). For operations like (“==”, “!=”, “=” and etc.) AxAssist determines type of the left operand and offers list of compatible variables.
In additional, for variables of “enum” type, list of values of enum’s is offered.
For example, ItemType::Item, ItemType::BOM, ItemType::Service are offered for enum ItemType.
If you type function call, AxAssist analyzes type of current parameter and offers list of compatible variables.
In Danish
In Russian
Axapta Editor
Variable names list
Variable names suggestion list appears after entering type and pressing space button.
Variable names suggestion with Ignored Prefix set to "MP_":
This feature is customizable.
You can configure it in \Classes\DEV_AxAssistUserList\addVariableNamesList method.
_nType - 0 - prefix, 1 - postfix. _nApply - DEV_AxAssistVarType::ALL - apply to all objects, DEV_AxAssistVarType::Table - apply for tables only and etc. _strPrefix - prefix or postfix string. _strType - if not empty - this suggestion applied only for this type. _strWholeName - if not empty - this string used like suggestion string. strPrefix is ignored.
Variable names list could be modified by user logic before suggestion will be appeared.
It could be performed in \Classes\DEV_AxAssistUserList\CheckVariableSuggestion method.
Axapta Editor
Name matching
This suggestion list base on AOT names.
The list contains all class, table, Extended Data Type and enum names including system types.
In Danish
In Russian
You can use Ignored prefix setting to exclude your company prefix from typing.
For example, you have company prefix for your objects "MP_".
Set Ignored prefix to "MP_":
Axapta Editor
Acronyms
Acronyms are short and simple abbreviations for symbols - typically the uppercase letters of a name. Type an acronym and AxAssist finds the symbol you want. Acronyms let you type code with fewer keystrokes.
In Danish
In Russian
You can use Ignored prefix setting to exclude your company prefix from typing.
For example, you have company prefix for your objects "MP_".
Set Ignored prefix to "MP_":
AxAssist shows additional information of the variables under cursor in Axapta Editor. If you working with unfamiliar code, AxAssist sheds light on any class, table, EDT or enum defined in currently opened element.
This behavior can be customized.
Hotkeys
AxAssist’s Editor hotkeys
AxAssist’s Editor hotkeys 1 to 3 are corresponding to the AxAssist’s Editor Toolbar buttons 1 to 3. That is, effect of hotkey №1 is similar with the effect of button №1 in AxAssist’s Editor Toolbar (comment out the selected lines). You can customize up to 20 hotkeys by writing appropriate processing in editorHotkey() method of DEV_AxAssistHotkeys class. See example in
How to add new hotkey.
AxAssist’s General hotkeys
As AxAssist’s Editor hotkeys, 1 to 6 AxAssist’s General hotkeys duplicate the functionality of the Main (AOT) AxAssist’s toolbar. You can customize up to 20 hotkeys by writing appropriate processing in globalHotkey() method of DEV_AxAssistHotkeys class. See example in
How to add new hotkey.
Code reformatter
Code reformatter makes code more readable.
Example:
Code before reformatter:
Code after reformatter:
This behaviour activated by 4th hotkey (by default).
Settings
Common settings
Use Tab - If checked every Indent will be increased to nearest right Tab position (1-5-9-13...).
Method parameters
Move first type and variable to next line -
If checked - move first type and variable to next line after function definition.
If not checked - first type and variable at the same line with function definition.
Indent 1 - number of spaces between "(" and first type.
Indent 2 - number of spaces between type and variable.
Indent 3 - number of spaces between '=' and longest variable with '='.
Method variables
Indent 1 - number of spaces between left border (col = 1) and type.
Indent 2 - number of spaces between type and variable.
Indent 3 - number of spaces between '=' and longest variable with '='.
Suggestions setting
Common settings
Enabled - controls activity.
Min number of characters - suggestion list will be appeared after typing equal or more characters.
Name matching
First capital letter - if enabled, list will be appeared only if case of first typed letter same as first letter of Dynamics AX type.
Case sensitive - defines mode of searching.
It is recommended to set "first capital letter" and "case sensitive" enabled in case of using Name matching and Acronyms logic together.
This could be illustrated by samples below:
Acronyms
Extended acronyms - If disabled the list is based on entered sequence only. If enabled the list is based on entered sequence (for example, IT) and its possible variations (ITA, ITB etc.).
This could be illustrated by samples below:
Ignored Prefix - Entered prefixes will be ignored when using Acronyms. It is usable for names of your objects.
You can use multiple Ignored prefixes - separete them with using ",". For example, "MP_, CPT, MSP_".
For example, you have variable type named MP_MyCustomTable. Set "Ignored Prefix" to "MP_" and you will see your variable in Acronyms suggestion list after typing "MCT". In other case you should enter MPMCT to see your variable.
Please be noticed, that you should restart Microsoft Dynamics AX client to accept new setting.
Acronym suggestion with Ignored prefix set to "MP_":
Name matching suggestion with Ignored prefix set to "MP_":
Acronym suggestion without Ignored prefix. In this case you should type your company prefix:
General settings
Suggestion sorting (on - by name, off - by group) - type of suggestion list sorting.
Open last suggestion hotkey - opens last suggestion list.
Alternative apply key - use this key as alternative to Enter key in suggestion lists.
Alternative up key - use this key as alternative to Up key in suggestion lists.
Alternative down key - use this key as alternative to Down key in suggestion lists.
How to
How to add new button on toolbar
To add new button to toolbar:
Open «ToolBar Editor» from «Settings» form («Settings» -> «View» tab -> Customize toolbars button).
Select toolbar you want to customize.
Select existing button, new button will be inserted after it.
Select icon for new button from list.
Press button Add.
Press button Save.
Method used as new button action could be added to class DEV_AxAssistHotkeys (run method) and DEV_AxAssistFunc (method itself).
See example in How to add new hotkey.
Added button will act as the corresponding hotkey (for example, button No5 will act as hotkey No5).
Supported bitmap size is 16*16 pixels with 24 or 32 bits of color.
All icons should be placed into "installation folder\\img". Black (RGB(0,0,0)) is used as transparent color.
How to
How to add new hotkey
As a sample let's add processing script “addVariableDefinition” for the 5th AxAssist's Editor hotkey.
Sequence of operations is the following:
1. Create processing method. To do so, create method static void addVariableDefinition(Editor e) in DEV_AxAssistFunc class (it is already exist in supplied default DEV_AxAssistFunc class)
2. Add following code to method void editorHotkey( int nHotkey, Editor e) in DEV_AxAssistHotkeys class (use static void globalHotkey( int nHotkey) for global hotkeys): ……
switch (nHotkey)
{ case #editorBaseId:
editor.comments_comment(e); break ; case #editorBaseId + 1:
editor.comments_uncomment(e); break; case #editorBaseId + 2: //open current element in AOT
DEV_AxAssistFunc::OnOpenInAOT(varTypeName, varTypeType); break ; case #editorBaseId + 3:
DEV_AxAssistFunc::activateReFormatter(formActiveXControl); break ; //--new code---> case #editorBaseId + 4:
DEV_AxAssistFunc::addVariableDefinition(e); //<--new code--- default : break;
}
……
4. Compile classes DEV_AxAssistFunc and DEV_AxAssistHotkeys.
5. Assign 5th AxAssist Editor hotkey (you can do this within “Editor hotkeys” tab in the AxAssist's “Settings” dialog).
Result:
How to use your text as suggestion
User List
To add new suggestion, add the following code into \Classes\DEV_AxAssistUserList\addUserList method:
newSuggestion – text of suggestion, for example "info(strfmt(\"%1\", ));", toolTip – tooltip text.
New suggestion will be appeared in list in according to settings (by default it is enough to enter two first symbols to get suggestion):
Note: new suggestion will be available only after reload of Dynamics AX client (if AxAssist is already running).
Therefore it is recommended to perform these changes before start AxAssist.
Acronyms list
Beginning with version 1.08.0 it is possible to define your own acronym for suggestion.
For example, to correlate acronym “FE” with “fieldExt2Id” in suggestion list you can add the following code into \Classes\DEV_AxAssistUserList\addUserList method:
formActiveXControl.addHelpItem( "fieldExt2Id" , "" , "Returns the fieldId part of an extended FieldId" , "FE" , 0, DEV_AxAssistVarType::ALL, DEV_AxAssistVarType::UserList, 0);
Note: new suggestion will be available only after reload of Dynamics AX client (if AxAssist is already running).
Result:
Function addHelpItem description:
void addHelpItem(str itemName, str itemTypename, str itemTip, str itemAcronym, int id, DEV_AxAssistVarType listType, DEV_AxAssistVarType dataType, int flag);
itemName – text that will be added to list of suggestion (for example, InventTable). itemTypename – type name corresponding with itemName. Can be used for variables of classes/tables etc. only. itemTip – tooltip text. itemAcronym – acronym corresponding with suggestion. If acronym is not defined then standard algorithm for acronym will be used. Id – ID of element in Dynamics AX or 0 (zero) if element do not have id. listType – type of suggestion list. Use DEV_AxAssistVarType::UserList for User list. For lists "Name Matching" and "Acronyms" use DEV_AxAssistVarType::ALL. dataType – inserting data type. flag – 0 – insert element, 1 – remove all elements from list listType, 2 – refresh element using its id (this value is used to synchronize AOT and AxAssist).
How to
How to customize tooltips
DEV_AxAssistTooltips class used for tooltip processing.
Description of the class DEV_AxAssistTooltips.
Methods:
Tooltips for classes: static str getClassToolTip(DictClass dictClass, boolean isVariable);
Tooltips for extended data types (EDT): static str getEDTToolTip(DictType dictType, boolean isVariable);
Tooltips for enums: static str getEnumToolTip(DictEnum dictEnum, boolean isVariable);
Tooltip for enums (of type ItemType::Item): static str getEnumValToolTip(DictEnum dictEnum, int idx);
Tooltip for table field: static str getTableFieldToolTip(DictTable dictTable, DictField dictField);
Tooltip for tables, maps and views: static str getTableToolTip(DictTable dictTable, boolean isVariable);
Each of methods return tooltip as string. To change tooltip it is necessary to change return value within corresponding method.
Variable isVariable is true, if tooltip is defined for variable, not for AOT element (e.g. class variable). For example, in this case it is usefully to show variable type, because it might be differ from variable name.
You can use some HTML tags to enrich tooltip representation. Have look into the sample:
Tip: use <br> tag instead of “/r/n”.
Tooltip will be presented as shown below:
Take into account that if you change logic of tooltips then tooltips for «Name Matching» and «Acronyms» lists will be changed after reload Microsoft Dynamics AX client only. List «Variables list» refreshed dynamically, therefore all changes become active immediately. Tip: use «Variables list» to play with tooltips.
How to
How to start AxAssist after Dynamics AX startup
If you want AxAssist to start after Dynamics AX startup:
Open Classes\Info
modify the startupPost() method for Microsoft Dynamics Axapta 3.0 or workspaceWindowCreated() for Microsoft Dynamics AX 4.0 as shown below:
FormRun formRun;
; // Put workspace window specific initialization here.
// if control is pressed - skip if(!WinAPI::isControlButtonDown())
{
formRun = new MenuFunction(menuItemDisplayStr(DEV_AxAssistForm),MenuItemType::Display).create(); if(formRun)
{
formRun.run();
formRun.detach();
}
}
Also, you can create security key for DEV_AxAssistForm menu item to manage access to this feature.
Note: Unfortunately this code does not work proper on current version of Microsoft Dynamics AX 5.0 (AX2009).