Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ActivateNew - method of object PmAlarmEvent

Description:
The dynamic creation of a new alarm/event item (the PmAlarmEventItem object) in the active and unacknowledged state (red) or the activation of already created item. The method returns the reference to the corresponding alarm/event item. The reference can be obtained also by calling the Item method.
Syntax:
ActivateNew(sId As String, sIdCopy As String, [sSource As String], [sDesc As String], [sComment As String], [sTimeOn As Date], [nAttr As Long]) As Object
Calling:
oAlEv.ActivateNew sId, sIdCopy, sSource, sDesc, sComment, tTimeOn, nAttr
Parameters:
sId(String) The unique text identifier of the new alarm/event item. This identifier is used for calling methods, for example: Activate, Inactivate, Acknowledge, Item, etc.

In case of event item the identifier can be empty, the item dissapears immediatelly, but it is recorded in the history (the same as for Delete inactive acknowledged (green) (valid only for dynamically created items)).

sIdCopy(String) The unique text identifier of an alarm/event item of template type (see the configurator "Template for dynamically created items"), whose configuration is used.
sSource[optional] (String) The specification of the source of an alarm/event item. It enables to the user to sort and filter items in the viewer in the running application according to the specified source. If not specified, the template value is used.
sDesc[optional] (String) The description itself of the alarm/event item. The basic text of the item that is displayed in the viewer in the running application. If not specified, the template value is used.
sComment[optional] (String) The text note that is stored into the data together with the activated alarm/event item (it is enabled on the Storage page).
sTimeOn[optional] (Date) The activation time of the alarm/event item. If not used, the current time of the computer is used.
nAttr[optional] (Long) Attributes that make more accurate the behaviour of the command when alarm/event item exist/doesn't exist.
0 (default) - When the alarm/event item with the specified idenfitier exists, the command makes the activation over the existing alarm/event item. When the alarm/event item with the specified idenfitier doesn't exist, the command creates a new alarm/event item with the activation that follows.
1 - When the alarm/event item with the specified idenfitier exists, the command fails. When the alarm/event item with the specified idenfitier doesn't exist, the command creates a new alarm/event item with the activation that follows.
Return Values:
Returns the reference to the newly created (or existing) and activated alarm/event item of the PmAlarmEventItem type. In case of an error, it returns the value Nothing (probably the item with the set Id already exists). Nothing value can be tested by VBScript Is operator.
See also:
Example:
oAlEv.ActivateNew "T1_HI", "HI", "Boiler", "T1 over high limit", "Temperature"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice