web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to find Model id from ModelInfo.md file

(0) ShareShare
ReportReport
Posted on by 147

Hi,

How to find Model id from ModelInfo.md file of a D365 project.

Any suggestions.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi TU1506,

    The model ID is visible in the xml file which can be found in the Descriptor directory of the model. This is part of the source code. If you don't have the source code, you can ask the vendor of the solution.

    What is the background of your question?

  • TU1506 Profile Picture
    147 on at

    Hi Andre,

    Thx for reply.

    Source code belongs to ISV , is it possible to get model id . We are having duplicate model id issue , wants to see the model id number at my end.

  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi TU1506,

    You can contact your ISV partner to check the model ID. Are you using two ISV solutions which might have a duplicate ID or is the ID conflict with an own customization model? If it is the last, you can change the ID in your own descriptor file.

  • TU1506 Profile Picture
    147 on at

    Hi Andre,

    One model belongs to us and same is already been moved to production 2 years back. Other belongs to ISV partner . Since i can see ModelInfo.md of ISV model , i was thinking to get model id from that without having dependency on ISV's confirmation about model id.

    Regards

  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi TU1506,

    I have no idea if the model ID is available in the ModelInfo.md file. At least the majority of the contents is not readable in Notepad. I'm also working for an ISV where we had a similar question before. We did provide the model ID value and tried to help getting rid of the conflict.

  • TU1506 Profile Picture
    147 on at

    Hi Andre,

    By using below code we can get model ids including of ISVs.

    class GetModelListCls

    {

       /// <summary>

       /// Runs the class with the specified arguments.

       /// </summary>

       /// <param name = "_args">The specified arguments.</param>

       public static void main(Args _args)

       {

           str60                   moduleName;

           int                     modelid;

           CLRObject               moduleModels, sanModels;

           CLRObject               modelEnumerator, sanEnumerator;

           str60                   moduleVersion;

           Microsoft.Dynamics.AX.Metadata.MetaModel.ModelInfo      modelInfo;

           moduleModels = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetInstalledModuleNames();

           modelEnumerator = moduleModels.GetEnumerator();

           while (modelEnumerator.moveNext())

           {

               moduleName = modelEnumerator.get_Current();

               sanModels = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetModelsInModuleSortedByDisplayName(moduleName);

               sanEnumerator = sanModels.GetEnumerator();

               sanEnumerator.MoveNext();

               modelInfo = sanEnumerator.get_Current();

               modelid   = modelInfo.SequenceId;

                   info(strFmt("%1 - %2 - %3",modelInfo.Module,modelInfo.Publisher,int2Str(modelid)));

           }

       }

    }

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Thank you for sharing your solution. Let me just simplify it a bit and paste in the right way (Insert > Code), to make it easier to read and copy:

    using Microsoft.Dynamics.AX.Metadata.MetaModel;
    using Microsoft.Dynamics.Ax.Xpp;
    
    class GetModelListCls
    {
        public static void main(Args _args)
        {
            var modules = MetadataSupport::GetInstalledModuleNames();
            var moduleEnumerator = modules.GetEnumerator();
        
            while (moduleEnumerator.MoveNext())
            {
                str moduleName = moduleEnumerator.Current;
                var models = MetadataSupport::GetModelsInModuleSortedByDisplayName(moduleName);
    
                var modelEnumerator = models.GetEnumerator();
                modelEnumerator.MoveNext();
    
                ModelInfo modelInfo = modelEnumerator.Current;
                int modelId = modelInfo.SequenceId;
                info(strFmt("%1 - %2 - %3", modelInfo.Module, modelInfo.Publisher, modelId));
            }
        }
    }

  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Thanks for sharing. I was not aware you installed the ISV solution already. I do assume you have your answer now?

  • TU1506 Profile Picture
    147 on at

    Hi Andre,

    Yes, that was the code , i was looking..

    Thx..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans