NXSL:SetCustomAttribute

From NetXMS Wiki
Revision as of 18:20, 21 December 2017 by Tomas Kirnak (talk | contribs)
Jump to navigation Jump to search

Set value of objects custom attribute. If attribute was not defined, it will be created.

Since: 1.1.1

Syntax

SetCustomAttribute(object, attributeName, value)

Parameters

object Any object of NetObj class, or its sub-classes.

You can use predefined variable $node to refer to current node. You can also use null as node if trusted nodes check is disabled (see Security Issues for more information).

attributeName Custom attribute name.
value New value for custom attribute.

Return Value

Previous value of requested custom attribute or NULL if attribute was not defined before.

Examples

SetCustomAttribute($node, "my_attribute", "new value")			-> "old value"
SetCustomAttribute($node, "non_existing_attribute", "new value")	-> NULL