I have been tasked with coming up with a way to report on all custom objects (tables, menu items, data entities, service operations, classes, roles, duties, privileges) within a D365FO environment. I thought I had a viable solution with the following:
1) Since Microsoft is sealing all base models, we can determine that all customizations must occur within a model within the ISV layer or above (layer 8 or above), so step 1 is generating this list of models.
//Limit modules to those with Layer >= 8 (ISV Layer) var modules = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetInstalledModuleInfo();
2) Take this list of models, and get all objects within these models
Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactory metadataProviderFactory = new Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactory(); var environment = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment(); str packageDir = environment.get_Aos().get_PackageDirectory(); Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration diskProviderConfiguration = new Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration(); diskProviderConfiguration.AddMetadataPath(packageDir); Microsoft.Dynamics.AX.Metadata.Providers.IMetadataProvider provider = metadataProviderFactory.CreateDiskProvider(diskProviderConfiguration); //This is just classes, there are other objects under the provider including tables, menu items, data entities, service opertations, etc var customClasses = provider.Classes.ListObjectsWithModificationInfo("ModuleName");
The above method works great for customizations made in the environment itself but the ListObjectsWithModificationInfo call will return a blank list if ran against a module from an ISV/3rd party (or any code) that was deployed via deployable package.
Is there any way using the above method to get this information, or can anyone think of another way to get this information?