ScriptContext.IsAlert Method

Determines whether the object provided to the script by MOM is an Alert object.

 ScriptContext.IsAlert()

Return Value

Long Integer

Examples

The following example shows how to determine whether the object provided to the script by MOM is an Alert object.

Function CreateNewAlert()
    Dim objCreatedAlert
    Dim objAlert

    Set objCreatedAlert = ScriptContext.CreateAlert()

    If (ScriptContext.IsAlert()) Then
        Set objAlert = ScriptContext.Alert

        objCreatedAlert.Name = objAlert.Name
        objCreatedAlert.AlertLevel = 50
        objCreatedAlert.Owner = "[unassigned]"
        objCreatedAlert.ResolutionState = 0  ' New
    Else
        Set objCreatedAlert = Nothing
    End If

    Set objAlert = Nothing

    Set CreateNewAlert = objCreatedAlert
End Function

Requirements

Platforms: Requires Windows 2000 or later

Version: Requires MOM 2000  or later

See Also

ScriptContext Object | Alert Object