Code highlighting

Thursday, May 29, 2008

EditorScripts.addIns_OpenInAOT - version 2

A long time ago, I posted an editor script for opening objects selected in the editor in AOT (link to that post)

Yesterday, miklenew from AxForum posted an editor script for AX 3.0 that opens a new AOT window with the object currently selected in the Editor, that works a little differently and also allows to open objects based on variable type. You can view the original post here.

Today I modified this code, extending it a bit and adding support for Dynamics AX 4.0 and Dynamics AX 2009 (For version 3.0 use the code posted on AxForum).

public void addIns_OpenInAOT(Editor e)
{
#AOT
TreeNode treeNode = TreeNode::findNode(e.path());
xRefTmpReferences xRefTmpReferences;
Column nCol = e.columnNo() + 1;
Line nLine = e.currentLineNo() + 1;
;
treeNode.AOTmakeXref(1);
xRefTmpReferences = xRefCreate::makeTmp(infolog.lastxRef());

select firstonly xRefTmpReferences
order by Column desc
where xRefTmpReferences.line == nLine &&
xRefTmpReferences.Column <= nCol;

if (!xRefTmpReferences)
return;

treeNode = TreeNode::findNode(xRefTmpReferences.path());

if (treeNode)
treeNode.AOTnewWindow();
}


As you can see, the code is very simple and utilizes the xReferences.
But the great thing about it is that updating the cross references is not required for this code to work, as it updates them on the fly for this specific AOT node.
I think this is a must have method for each application developer out there. :)

Tuesday, May 13, 2008

AxPaint / AxAssist for Axapta 3.0, AX 4.0 and AX 2009

First of all, I would like to remind anyone interested of what AxPaint is. This is a small activeX component + a small xpo, that will allow you to change the background image of your application to whatever image you like.
You can find installation instructions, screenshot and a more detailed description through the link below:
http://kashperuk.blogspot.com/2007/06/axpaint-make-your-dax-look-cool.html

Well, the tool has recently been updated with support for all versions of AX starting with version 3.0.
The download link for the new (and, most probably, final) version of this tool is AxPaint.
Enjoy! :)

Also, it is hard not to mention another development tool from the same author, AxAssist. Sadly, it is not free, but it is still worthwhile to check it out - maybe that's something you company would be interested in buying. There is a Trial version you will be able to play around with for 30 days. The homepage for the tool is - www.axassist.com