5 Comments

    • 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.

Leave a Reply to Martin Dráb Cancel reply

Your email address will not be published. Required fields are marked *