Promotic
WikipediaLinkedInYoutubeTwitterFacebook

onUserItemAction - event of object PmAlarmEvent

Description:
The event fires when selecting the corresponding action in the state viewer by the local/net user.
Parameters:
pMe(Object) Reference to the Promotic object where the event rises.
pEvent(Object) A referrence to object describing detailed information about the specific event.
pEvent.Action - (String) Specifies the selected action over the alarm/event item.
ack - The user selected the acknowledgement of the selected alarm/event item in the state viewer.
ackall - The user selected the acknowledgement of all alarm/event items in the state viewer.
pEvent.ItemId - (String) The identifier of the selected alarm/event item (if it doesn't go about multiple operation).
pEvent.TimeOn - (Date) The rise time of the selected alarm/event item (if it doesn't go about multiple operation). It goes about supplementary information to the identifier of the alarm/event item, that allows unambiguous idenfication of the selected alarm/event item. If it is allowed to store inactive, unacknowledged (blue) alarms in the Number of inactive, unacknowledged alarms (blue) to keep configurator, then more alarm/event items can have the same identifier.
pEvent.Context - (Object) Reference to the object containig additional information about the user, that executed the action followed by calling this event. The creation and demise of the alarm is always done by the local user. The alarm confirrmation can be executed both by local and network application user (e.g. from the web client). The user info can be used, for example, for enabling/disabling the action (if possible), or for entering the user info into the alarms/events.
pEvent.Context.User - reference to the User object, containing detailed information about the user (local or network), that executed the action that called the method.

Caution! In order to keep the subobject User value trustworthy it is necessary to exclude the the pseudo-groups $ANY and $ANY_NET from the appropriate permission WebRead (i.e. to ensure that the user is logged in when opening the WEB panel).

pEvent.Context.Language - Returns the information about the national language. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. See the configurator "PmRoot > Application > Main language of runtime".
pEvent.Enabled - (Boolean) Specifies if the required action is performed over the selected alarm/event item or not.
true (default) - Alarm/event system performs the selected action over the selected alarm/event item.
false - Alarm/event system doesn't perform the selected action over the selected alarm/event item.
See also:
Example:
Into the Debug_info item of the INFO system we will write every change of each item connected with the logged-in user:
Pm.Debug "Alarm - Action=" & pEvent.Action & ", itemId=" & pEvent.ItemId & " -> user=" & pEvent.Context.User.Id & ", Time=" & Now
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice