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:
- findTreeNode
- getNode
- getNodePath
- parentElement
- parentName
The static methods on xUtilIdElements are very similar:
- find
- findTreeNode
- getNode
- getNodePath
- parentElement
- parentName
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.
Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.
Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.