Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
AX 7 (“Microsoft Dynamics 365 for Operations”) offers a new API for getting metadata of AX elements such as tables, form extensions, models and so on. It’s very easy to use, therefore even if you’re very familiar with the old TreeNode API, you should definitely pay attention to this new one.
The best place to start is in the MetadataSupport class in Microsoft.Dynamics.Ax.Xpp namespace (yes, the whole API is in an external library; it’s not written in X++).
The class offers many static methods providing information about elements. Taking tables as an example, you can use:
The MetadataSupport class also offers a few helper methods such as IsTableMapped() and ConvertAxUserTypeToBaseType().
Element details are represented by classes with names prefixed with Ax. For example, GetTable() returns an instance of AxTable class. (All these classes are defined in another assembly; the namespace is Microsoft.Dynamics.AX.Metadata.MetaModel).
These classes provide all details you may need. For tables, you can see properties, fields, indexes, methods and everything else.
Let me give you a full example that you can take and run in your environment. It iterates all controls in a given form and put their names to infolog.
public static void main(Args _args)
AxForm form = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetForm(formStr(SysUserSetup));
private void showControlNames(IFormControlCollection _control)
var controlEnumerator = _control.Controls.GetEnumerator();
AxFormControl control = controlEnumerator.Current;
if (control is IFormControlCollection)
this.showControlNames(control as IFormControlCollection); // Recursion
There are a few things to notice:
I truly enjoy working with this new metadata API – it’s nicely designed and easy to use. The only problem might be that you need to be a bit familiar with .NET Interop (= accessing .NET objects from X++), but even if you aren’t, you’ll quickly learn those few things you need.
Business Applications communities