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, ...
Suggested Answer

How to export a form to xpo file with what ever layer i want

(0) ShareShare
ReportReport
Posted on by

Hi All,

I would like to export any AOT node(eg:Form-Accountant_BR) to xpo file but through code (x++)  from different layers (usr,cus,sys) while exporting.

Thanks,

Phani

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Try something like this:

    #AOT
    TreeNode formNode = TreeNode::findNode(#FormsPath   #AOTDelimiter   formStr(Accountant_BR));
    treeNodeCus = treeNode.getNodeInLayer(UtilEntryLevel::cus);
    if (treeNodeCus)
    {
    	treeNodeCus.treeNodeExport(strFmt(@'c:\temp\%1%2.xpp', treeNode.AOTname(), UtilEntryLevel::cus));
    }

    By the way, why are you doing it?

  • Community Member Profile Picture
    on at

    Hi Martin,

    I have tried the above code for usr layer and it gives the sys changes as well in that . Kindly help me

    Thanks,

    Phani

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

    Im sorry, I don't have any AX 2012 environment anymore, therefore I can't test it. But I believe that it should work. Make sure you call treeNodeExport() on treeNodeCus and not treeNode.

    If nothing helps, look at the standard code that handles exports from GUI.

  • ToddB Profile Picture
    on at

    Hi Phani,

    Were you able to export using the information provided by Martin?

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 646 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