12 Comments

  1. Thanks again for an excellent post! I was still grieving the loss of the old APIs for this, but this looks like just what we need. I see curious methods like AddMethod and such on these APIs in your screenshots. Can you really add metadata such as tables, classes and methods to a running application using these techniques??

  2. Thank you! Very useful post!
    Martin, could you give me advice about how can I find references to some object? For example, I have a table and I want to find all references to this table (like in Visual Studio menu item “Find references”) using metadata API?
    Thanks!

  3. Hi Martin,

    Let’s say I’ve used the metadata API to find a specific AxFormControl of interest in the CustTable form. Is there a way to use this AxFromControl to lookup the actual control on a FormRun Instance?
    As AxFormControl dosen’t have an id().
    eg. formrun.design().control(axformControl.id()).setFocus();

  4. Hi Martin,
    I want to get all the display menuItems from menus how can I do this using metadata API ?

  5. Hi Martin,
    Thanks for helfpul post,
    please i have quick question i want to iterate the MenuExtensions provider,

    Here is my code:

    var environment = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment();
    str packageDir = environment.get_Aos().get_PackageDirectory();

    var runtimeProviderConfiguration = New Microsoft.Dynamics.AX.Metadata.Storage.Runtime.RuntimeProviderConfiguration(packageDir);
    var metadataProviderFactory = New Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactory();
    var provider = metadataProviderFactory.CreateRuntimeProvider(runtimeProviderConfiguration);

    CLRObject extendedMenus = provider.MenuExtensions;
    var listEnumerator = extendedMenus.getEnumerator();
    While (listEnumerator.moveNext())
    {
    // Here i want iterate each AxMenuExtension menu in listEnumerator
    //AXMenuExtension menuExtension;
    }

    My code at on : var listEnumerator = extendedMenus.getEnumerator();

  6. Hi Martin,

    This is good article which i used in my development.

    One quick question is how to get label of the form control. I have AxFormControl object which has no function to get the label. Please help.

    Thank you.

  7. Hi,
    I extended a form and added a new datasource, but using this API, the new datasource is not listed. Is this API not working with extensions?

    • The metadata API supports extensions, but you need to choose whether you want to get them or not. Note that MetadataSupport is just a simplified interface and it doesn’t expose all features of the API.
      For example, this will create a provide with extensions applied:

      using Microsoft.Dynamics.ApplicationPlatform.Environment;
      using Microsoft.Dynamics.AX.Metadata.Storage;
      using Microsoft.Dynamics.AX.Metadata.Storage.Runtime;

      ...

      str packageDir = EnvironmentFactory::GetApplicationEnvironment().Aos.PackageDirectory;
      var runtimeProviderConfiguration = new RuntimeProviderConfiguration(packageDir);
      var provider = new MetadataProviderFactory().CreateRuntimeProviderWithExtensions(runtimeProviderConfiguration);

Comments are closed.