TreeNode.treeNodeExport Method [AX 2012]

Exports this node and its subtree from the Application Object Tree (AOT).

public void treeNodeExport(str filename, [int flag])

Run On

Called

Parameters

filename
Type: str
The file name for the export file.
flag
Type: int

If an attacker can control input to this method, a security risk exists. Therefore, this method runs under Code Access Security. Calls to this method on the server require permission from the . Ensure that the user has development privileges by setting the security key to SysDevelopment on the control that calls this method.

This example uses the treeNodeExport method to export the ExampleClass class to an .xpo file.

void TreeNodeExample() 
{ 
    TreeNode treeNode; 
    TreeNode childNode; 
    FileIoPermission perm; 
  
    #define.ExportFile(@"c:\TreeNodeExportExampleClass.xpo") 
    #define.ExportMode("w") 
  
    perm = new FileIoPermission(#ExportFile, #ExportMode); 
    if (perm == null) 
    { 
        return; 
    } 
  
    perm.assert(); 
  
    treeNode = TreeNode::findNode(@"\Classes"); 
    if (treeNode != null) 
    { 
        childNode = treeNode.AOTfindChild(@"ExampleClass"); 
        // BP deviation documented. 
        childNode.treeNodeExport(#ExportFile); 
    } 
  
    CodeAccessPermission::revertAssert(); 
}

Community Additions

ADD
Show: