beautypg.com

Alertmod – Visara Master Console Center Scripting Guide User Manual

Page 76

background image

Chapter 5 Script Commands

Scripting Guide

76

ALERTMOD

Syntax:

ALERTMOD( %AlertID, %AlertField, NewValue) ==> %ErrCode

Description:

Modifies the value of a field in an existing Alert.

Action:

In the alert specified by %AlertID, the value of the field specified by

%AlertField is changed to the new value specified by NewValue.

Parameters:

%AlertID. Numeric expression. The unique alert ID of the alert to be

modified.
%AlertField. Numeric expression. The number representing the field
to change the value of. Use the following manifest constants to

reference the fields:

Constant
ALERTFIELD_STATUS

ALERTFIELD_STATE
ALERTFIELD_SOURCE

ALERTFIELD_MSG

ALERTFIELD_USERNOTE

Value

2

4

64

128

256

NewValue. String or numeric expression. The new value to set the

field to. Be sure to use the correct data type for the field to be
modified. Using the incorrect data type (for example, changing

ALERTFIELD_STATE to a string) can have unpredictable results.

Returns:

Numeric value, as follows:
Value

Status

0

SUCCESS

-22

%AlertID is invalid, or the ALERTMOD( ) failed

Notes:

ALERTFIELD_MSG and ALERTFIELD_USERNOTE have a

maximum length of 450 characters. Attempting to put longer strings

into those fields will cause ALERTMOD( ) to fail.

Example:

%ErrCode := ALERTMOD(%AlertID, ALERTFIELD_STATE,

ALERTSTATE_CLOSED)
%ErrCode := ALERTMOD(%AlertID, ALERTFIELD_USERNOTE,
“Automatic correction procedures have failed.”)

See Also:

ALERTCREATE, ALERTDEL, ALERTGETACTIVE