static void jobEnumerateModels(Args _args) { SysModel sysModel; SysModelManifest sysModelManifest; container selectionList; // Select models from specified layer while select Model, Name, Publisher, DisplayName from sysModelManifest join firstonly Layer from sysModel where sysModel.RecId == sysModelManifest.Model && sysModel.Layer == UtilEntryLevel::usr { selectionList += [SysListSelect::packChoice(strFmt('DisplayName: "%1"\n ModelName: "%2"\n Publisher: "%3"', sysModelManifest.DisplayName, sysModelManifest.Name, sysModelManifest.Publisher), any2int(sysModelManifest.Model), false)]; } conView(selectionList); }
This technical blog will be about my adventures with Microsoft Dynamics 365 for Operations (AX7/D3fo), AX 2012, and AX 2009.
Monday, March 31, 2014
Models: How to enumerate list of models from X++ [AX 2012]
I'm creating custom Best Practice checks and I needed to enumerate the existing models in my model store. Here is a simple job that demonstrates how. My next post will build on this. The code is a tweak of \Classes\SysModelStore\buildSelectionModels.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment