Difference between revisions of "NXSL:FindObject"
(Created page with "__NOTOC__ Find NetXMS object by object id or name. == Syntax == FindObject(''id'', ''node''); == Parameters == :{| |- | ''id'' || ID or name of the object to find. |- | ...") |
m (Text replacement - "^" to "{{deprecated}}") |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{deprecated}}__NOTOC__ | ||
Find NetXMS object by object id or name. | Find NetXMS object by object id or name. | ||
'''Since:''' 1.2.0 | |||
Line 14: | Line 16: | ||
| ''id'' || ID or name of the object to find. | | ''id'' || ID or name of the object to find. | ||
|- | |- | ||
| ''node'' || Node object, you can use predefined variable $node to refer to current node. You can also use null or omit this parameter if trusted nodes check is disabled (see | | ''node'' || Node object, you can use predefined variable $node to refer to current node. You can also use null or omit this parameter if trusted nodes check is disabled (see [[SG:Security Issues|Security Issues]] for more information). | ||
|} | |} | ||
Line 20: | Line 22: | ||
== Return Value == | == Return Value == | ||
Object of NetObj or one of its sub-clases (depending on found object type) with given id or name on success or '''null''' on failure (either because object with given name/id does not exist, or access to it was denied).<br> | |||
For more info see [[NXSL Class Reference|NXSL Class Reference]]. | |||
Latest revision as of 16:13, 13 September 2022
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide) |
Find NetXMS object by object id or name.
Since: 1.2.0
Syntax
FindObject(id, node);
Parameters
id ID or name of the object to find. node Node object, you can use predefined variable $node to refer to current node. You can also use null or omit this parameter if trusted nodes check is disabled (see Security Issues for more information).
Return Value
Object of NetObj or one of its sub-clases (depending on found object type) with given id or name on success or null on failure (either because object with given name/id does not exist, or access to it was denied).
For more info see NXSL Class Reference.
Examples
FindObject("server.netxms.org", $node) -> object FindObject(2) -> object FindObject("bad_object_name", $node) -> NULL