Modules

filter

 

Objects/Functions

module (N/xml)

SuiteScript 2.0

Node.insertBefore(options)

{Node}.insertBefore({newChild: {xml.Node},refChild: {xml.Node}})

N/xml Module
Node.insertBefore()
Method Description: Inserts a new child node before an existing child node for the current node. If the new child node is already in the list of children, this method removes the new child node and inserts it again.
Returns: xml.Node
Supported Script Types: All script types For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/xml Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Node.insertBefore(options)

Example:

// Code Example 1
//Add additional code
//...
var insertednode = parentNode[0].insertBefore({
newChild : elemlist1[0],
refChild : elemlist2[0]
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_452156005859.html