Go to documentation repository
Documentation for Intellect 4.11.0-4.11.3. Documentation for other versions of Intellect is available too.
Previous page Next page
The GetObjectParentId method returns the identification number of the parent of the specified object.
Method call syntax
function GetObjectParentId(objtype : String, id : String, parent : String) : String
Method arguments:
- objtype - Required argument. 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.
- 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 values: Type – String, range – existing object types.
Usage examples
Problem. If a camera turns off or stops transmitting a video signal, send an e-mail message with the following subject: "Warning! Camera turned off" and, in the message body, the number of the camera and of the server it is connected to.
Note
The Short Messages Service is supposed to be installed and working properly
if (Event.SourceType == "CAM" && Event.Action == "DETACH") { var cam_id = Event.SourceId; var parent_comp_id = GetObjectParentId("CAM", cam_id, "COMPUTER"); DoReactStr("MAIL_MESSAGE","1","SETUP","from<***@mail.ru>,to<***@mail.ru>,body<Camera disabling "+cam_id+" on the Server"+parent_comp_id+">,parent_id<1>,subject<Attention! Camera disabling>,name<Message 1>,objname<Message 1>"); DoReactStr("MAIL_MESSAGE", "1", "SEND", ""); }
Overview
Content Tools