简体   繁体   中英

Ax2009 Tree node export

Is there another way to export TreeNodes from AX2009 besides TreeNode.treeNodeExport(filename) ?

Is there possibly a way of doing this based on the UtilElements table?

EDIT When calling treeNodeExport while connected with the .Net Business connector, the method .treeNodeExport fails. I was wondering if there is another way of exporting a TreeNode to an xpo file in order to work around this. This occurs mainly with the ProjectNodes.

I'd try and resolve the reason your method call fails. Have you tried asserting write permissions first?

new FileIoPermission(@'C:\\MyOutput.xpo', 'w').assert();

Does your treeNodeExport method call fail because of the file-system on either client/server ? IE if you're making a call to export to C:\\Users\\Alex\\Desktop\\MyXPO.xpo , that location may not exist if it's on the server tier.

Alternatively , if you are using the business connector, which is using the business connector user account , then that user account may not have permission to write to the directory you are trying to export to.

Not sure what your requirements are, but if you could use treeNodeExport and just want to convert a record of UtilElements into a TreeNode you could use the following snippet:

public static client void TestJob()
{
    UtilElements utilElements;
    ;

    // select firstOnly utilElements
    //     where utilElements ...  

    xUtilElements::getNode(utilElements).treeNodeExport(@'C:\temp\test.xpo');
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM