Go to documentation repository
Page History
The GetObjectParentId method returns the identification (registration)number of the parent object of the specified object.
Method call syntaxSyntax for method invocation:
Code Block | ||
---|---|---|
| ||
function GetObjectParentId(objtype : String, id : String, parent : String) : String |
Method arguments:
- objtype - Required is a required argument. The It specifies the type of the object whose parent’s identification number should be returned. It takes the following values: Type – String, range – existing object types.
- id - Required argument. Identification number of the object of the type set in the objtype argument. It takes the following values: Type – String, range – existing identification numbers of the objects of the specified type.
- system object, for which you want to return the type of parent object. Possible values: String type, range is limited by object types registered in the system.
- id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argument. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in the system.
- parent is a required argument. It specifies the type of the system object that is the parent object (main object in the system hierarchy of objects) of the object parent - Required argument. The type of the object which is the parent of the object type specified by the objtype argument. It takes the following Possible values: Type – String type, range – existing is limited by object types registered in the system.
Usage examples
ProblemExample. If a camera turns off or stops transmitting a video signal, send an e-mail message with the following email message registered in Intellect under number 1. The message must include the subject: "Warning! Camera turned off" and, in the message body, the number of the camera and of the server it is connected to.
Info | ||
---|---|---|
| ||
The Short Messages Service is supposed to must be installed and working work properly. |
Code Block | ||
---|---|---|
| ||
if (Event.SourceType == "CAM" && Event.Action == "DETACH") { var cam_id = Event.SourceId; var parent_comp_id = GetObjectParentId("CAM", cam_id, "COMPUTERSLAVE"); DoReactStr("MAIL_MESSAGE","1","SETUP","from<***@mail.ru>com>,to<***@mail.ru>com>,body<Camera turned disablingoff "+cam_id+" on the Server"+parent_comp_id+">,parent_id<1>,subject<Attention! Camera disabling>turned off>,name<Message 1>,objname<Message 1>"); DoReactStr("MAIL_MESSAGE", "1", "SEND", ""); } |
...
Overview
Content Tools