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 :
Microsoft Dynamics AX (Archived)

TreeNode AOTgetProperty("Model") return different values on Client and Server

(0) ShareShare
ReportReport
Posted on by 52

Hello, everyone!

The subject is next:
I'm creating instance of TreeNode object. It has property "Model". On client this property has value "Foundation". On server this property has value "19". (values provided for example).
So, the problem is when I call method AOTgetProperty("Model") it returns "Foundation" on Client and "19" on Server.

Example of code:

TreeNode treeNode;
ModelName modelNameRet;

treeNode = TreeNode::findNode(@"\Data Dictionary\Base Enums\ABC");

modelNameRet = parentTreeNode.AOTgetProperty("Model");

info(modelNameRet);

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,284 on at

    Hi EugeneVoloshchenko,

    It would be nice if you explain what you are  actually doing and what you want to achieve. 

  • EugeneVoloshchenko Profile Picture
    52 on at

    I need to get Model name of an object. And I need to put Model name of an object to my table. I don't need to get model ID.

    For this purpose I create TreeNode object from AOT path. I run my code in batch, so the problem I described above occures.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    I don't know the answer and I don't think that someone except MS really knows it. 19 is a model id for Foundation and you can get a name using SysModelStore::modelId2Name() static method.

    However, I would not use TreeNode API at all and go though SysModelElement that gives you same result on client and server:

        SysModelElement         sysModelElement;
        SysModelElementData     sysModelElementData;
        utilModels              utilModels;
    
        
        select sysModelElement
            where sysModelElement.Name == "ABC"
                join sysModelElementData
                    where sysModelElement.RecId == sysModelElementData.ModelElement
                        join Name from utilModels
                            where utilModels.Id == sysModelElementData.ModelId;
        
        info (utilModels.Name);

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans