Skip to main content

Notifications

Announcements

No record found.

AOT node compare

One of the most often used tool is the AOT node Compare utility, which has some improvements from the past but can be changed further.

Now in AX 2012 the compare tool can be executed as CIL code rather than in the X++ runtime tier, which should give you considerable performance boost for larger code comparison. Here is a great post (The compare tool–and running X++ code as IL) from mfp about improvements that Microsoft did.

On the other hand you can do some improvements yourself by adding the following line to the SysCompare class, selectionChanged method:

(...)
}

//--> WIK
allowInsert = true;
//<-- WIK

this.compare(text1,
text2,
mergeToTopNode ? mergeToTopNode.comparableName() : '', // ext
mergeFromTopNode ? mergeFromTopNode.comparableName() : '', // ext
showLineNumbersHere,
singleLines,
allowInsert,
allowRemove,
alternatingLines,
supportHighlight);
(...)

This allows you that for example when you compare objects that is being imported from an XPO file, you will be able to add new objects which would not be allowed otherwise, like new fields.

The other improvement you might want to do is to get back the good old AX 4.0 behaviour, by always having the lower layer on the top of the compare form, thus highlighting the new changes in blue colour. The simplest solution is adding a button next to the buttongroup on the SysCompareForm form to switch the layers around, with the following lines in the clicked method:

void clicked()
{
int currentSelection = ComboBox1.selection();

super();

if (ComboBox1.items() > 0 && ComboBox2.items() > 0)
{
ComboBox1.selection(ComboBox2.selection());
ComboBox2.selection(currentSelection);
}
}

Comments

*This post is locked for comments