5 Comments

  1. Hi Martin,
    It’s very useful your article. Great job!
    But maybe you could help me get the name of its service group ?
    Thanks you!

    • First of all, realize that it’s not necessarily a single service group.
      I don’t think that the service knows which service groups refers to it, but you can easily iterate service groups and look for the service:

      using Microsoft.Dynamics.AX.Metadata.MetaModel;
      using Microsoft.Dynamics.Ax.Xpp.AxShared;
      using System.Collections;
      ...
      IEnumerator groupEnumerator = MetadataShared::Provider.ServiceGroups.GetPrimaryKeys().GetEnumerator();
      while (groupEnumerator.MoveNext())
      {
          AxServiceGroup serviceGroup = MetadataShared::Provider.ServiceGroups.Read(groupEnumerator.Current);
          if (serviceGroup.Services.Contains('SysWorkflowConfigurationService'))
          {
              info(serviceGroup.Name);
          }
      }
      • Many thanks Martin! I’m new to AX so I have a lot to learn.
        By the chance could you recommend me a good resource about learning to work with metadata in D365?

        • Unfortunately I’m not aware of any documentation, just a few blog posts like this one.
          What sometimes help me is decompiling DLLs with metadata classes and checking the actual implementation, e.g. to find a method that gives me what I need.

  2. This is a good idea! I will do so.
    Thanks a lot Martin for your fantastic help!

Comments are closed.