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 get the output of compared aot objects for different layers?

(0) ShareShare
ReportReport
Posted on by

Hi  All,

Is there any way that I can get the result into a file of compared AOT objects of two different layers?  

Thanks,

Phani

  • Martin Dráb Profile Picture
    231,923 Most Valuable Professional on at
    RE: How to get the output of compared aot objects for different layers?

    I'm sorry, I could help you with the development, but I don't have any already written code that I could give to you.

    If I was you, I would start by reviewing the output if you compare layers manually. If the result is (roughly) what you want, then you can simply reuse the same logic. It's using classes like SysCompare and SysComparable, if I remember it correctly. I can't check it, because I don't work with AX 2012 anymore, but you can.

    If the output isn't what you want, you need to consider your options. Maybe it's the right data, you just want a different visualization. Then you can keep the comparison logic and you'll merely change the output. Or maybe you need something completely different - then the question is what you actually want. One other option I can think of is exporting the objects to .xpo files and comparing these files by an external tool.

  • Community Member Profile Picture
    on at
    RE: How to get the output of compared aot objects for different layers?

    Hi Martin,

    TreeNode sysVersion = SysTreeNode::findNodeInLayer(UtilElementType::Form, formStr(Accountant_BR), 0, UtilEntryLevel::sys);

    TreeNode usrVersion = SysTreeNode::findNodeInLayer(UtilElementType::Form, formStr(Accountant_BR), 0, UtilEntryLevel::usr);

    Now I have user level and sys level modified forms. I would like to use Syscompare class methods which gives the differences same like compare tool (compare,silentcompare of syscompare class which is suitable).

    I am new to Ax2012 and x++ . so I have been asking for code snippet.

    Thanks,

    Phani

  • Martin Dráb Profile Picture
    231,923 Most Valuable Professional on at
    RE: How to get the output of compared aot objects for different layers?

    Unfortunately you didn't tell us where you got stuck, therefore it's not clear what code you're asking for.

    I can only guess that you failed already on the first step. Try this:

    TreeNode sysVersion = SysTreeNode::findNodeInLayer(UtilElementType::Form, formStr(Accountant_BR), 0, UtilEntryLevel::sys);

    By the way, the fact that you know class and method names allows you to search for solutions both on internet and in AX.

  • Community Member Profile Picture
    on at
    RE: How to get the output of compared aot objects for different layers?

    Hi Martin,

    Thanks for your reply.

    I have a form Accountant_Br modified in usr layer and able to compare the same with sys layer and get the differences .

    Same thing i want to achieve using code X++.

    Could you please provide sample code if u can as explained above?

    Thanks,

    Phani

  • Martin Dráb Profile Picture
    231,923 Most Valuable Professional on at
    RE: How to get the output of compared aot objects for different layers?

    Exporting data to a file shouldn't be difficult, therefore I think you should focus on getting the differences.

    I don't remember details of these APIs, but you should be able to extract implementation from a given layer with SysTreeNode::findNodeInLayer() and hopefully SysCompare can give you a output that would be useful for you.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,202 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans