Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
 function GetObjectParentId(objtype : String, id : String, parent : String) : String

Method arguments:

  1. 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.
  2. 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.
  3. 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.

...

Info
titleNote

 The Short Messages Service is supposed to be installed and working properly.


Code Block
languagejavascript
if (Event.SourceType == "CAM" && Event.Action == "DETACH")
{
 var cam_id = Event.SourceId;
 var parent_comp_id = GetObjectParentId("CAM", cam_id, "SLAVE");
 DoReactStr("MAIL_MESSAGE","1","SETUP","from<***@mail.com>,to<***@mail.com>,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", "");
}

...