Tree.saveNode (Method)

Creates a new tree node, or updates and existing one.

Returns:

TreeNodeID (integer)

Arguments:

Name Type Required Description
id TreeID Required The unique ID of the tree.
nodeID TreeNodeID_0 Required The unique ID of the tree node to update, or 0 to create a new node.
parentNodeID TreeNodeID_0 Required The unique ID of the parent node, or 0 for root node.
title PlainText_NonNull_255 Required The title of the tree node.
description PlainText_2000 Optional. Defaults to an empty string. The description of the tree node.
position NonNegativeInteger Optional. Defaults to '0'. The position of the tree node, 0 for last position.
targetID PageID_0 Optional. Defaults to '0'. The unique ID of the target page, uploaded document, registered URL, pageset or multimedia file, otherwise 0 (or not passed).
targetURL PlainText Optional. Defaults to an empty string. The fully qualified URL, if the node links to an external URL, otherwise an empty string.
targetMouseOver PlainText_255 Optional. Defaults to an empty string. The mouse over action.
targetWindowParams LinkTargetWindowProperties_Struct Optional. Defaults to '#Request.TypeFactory.getStruct('LinkTargetWindowProperties_Struct')#'. Structure of parameters for the target window.
itemClass CSSNameList_100_EmptyString Optional. Defaults to an empty string. The item class of the tree node.
imageID ImageID_0 Optional. Defaults to '0'. The unique ID of an image or 0 for no image.
state ActiveInactive Optional. Defaults to 'Active'. The state of the tree node, i.e. 'Active' or 'Inactive'.
properties Struct Optional. Defaults to '#StructNew()#'. A structure that describes all of the properties for the tree node.

Context:

License Requirements (none)
Permission Requirements treeNav:Edit
Deny Context (none)
Require Context AuthoringEnabled
Author Lock (not required)
Transaction Logging If transaction logging is enabled at the site level, calls to this method will be logged
Customization Customization is not supported for this method.

Error Codes:

Code Error Message
403  
409  
87504 The specified node is not valid for the specified tree.
87507 The specified parent node is not a valid node for the specified tree.
87512 A node cannot be made its own descendant.

Notes:

None