Autocomplete text in MorphX Editor

One useful tool in Dynamics AX MorphX Editor is the Autocomplete function. For example, if you type if and click the Tab Button the if statement autocompletes.


Nifty! But what if you want to add your own Autocomplete function: let’s say if you type info and click the Tab Button you want info(StrFmt(“%1”, )); to be inserted.


Just add following method to class xppSource

Source info(Source _variable = '')
    source += @'info(StrFmt("%1", ));';
    source += '\n';
    return source;


Add the following method to class EditorScripts


public void template_flow_if(Editor editor)
    xppSource xppSource = new xppSource(editor.columnNo());
    int currentLine = editor.currentLineNo();
    int currentCol = editor.columnNo();
    Source template = xppSource.if();



The result will look like this:


Hope this helped.

Posted in Tools and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *