Question:
How can I record in the database which user was logged in when the alarm went off?
Solution:
To do so, one alternative is to use an internal tag (in this example called LoggedInUser), and then create a script in the Viewer‘s OnLogin event attributing to this tag the name of the user logged in.
Example:
Sub Viewer_OnLogin()
Application.GetObject(“Dados.LoggedInUser”).Value = User
End Sub
Application.GetObject(“Dados.LoggedInUser”).Value = User
End Sub
After this, you must create in the Alarm Server a USER FIELD linked to this tag, which must be added to the table’s fields.