Reputation: 296
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.
Upvotes: 1
Views: 392
Reputation: 11544
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
? I.E. 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.
Upvotes: 2
Reputation: 35338
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');
}
Upvotes: 1