nxsl: function to get object of an event

Started by Dmitri Lunyov, January 30, 2020, 08:34:49 AM

Previous topic - Next topic

Dmitri Lunyov

I didn't find a way to get object of an Event and, consequently, parameters of an Event from a script that does not inherit reference $event (e.g. running from scheduler). I can get object of an Alarm and then get id of origin Event among attributes of the Alarm, but it's no nxsl's function to get object of the Event neither by id nor somehow else.

Is this because of security rules or it can be implemented?

So far I have to use Persistent Storage to save parameters from an Event and to get them from a script later. This way is not very convenient.

Victor Kirhenshtein

You can load event from database using function LoadEvent. It accepts single argument - event ID, and returns event object.

Best regards,
Victor

Dmitri Lunyov