Using xUtilElements and xUtilIdElements When Upgrading from Dynamics AX 2009 to Dynamics 365 for Operations (AX7)
Recently I was asked to provide an estimate on how long it would take to upgrade a client from AX 2009 to Dynamics 365 for Operations (AX7). To derive accurate estimates, I wrote a class which uses reflection classes to iterate over the AOT and generate an estimate. In this case, I was writing my estimation class in AX 2009. I discovered two classes I had not used before that, along with the TreedNode class are very helpful when digging through metadata in 2009. The classes are xUtilElements and xUtilIdElements. I had previously worked with UtilElements and UtilIdElements without realizing they were extending kernel classes.
What kinds of methods can you find on xUtilElements and xUtilIdElements?
Here are some of the static methods on xUtilElements:
The static methods on xUtilIdElements are very similar:
In my case xUtilElements::parentElement(UtilElement) was exactly what I needed. It returns an instance of UtilElements that is the parent of the passed in UtilElement.