Automation Engine Script Guide > Ordered by Function > Error Handling and Messages > :SEND_MSG

:SEND_MSG

Script Statement: This statement is used to send messages to the user who is logged on to the UserInterface.

Syntax

:SEND_MSG Name, Department, Message

Syntax

Description/Format

Name

Name of the user who has logged on to the UserInterface and should receive the message.
Format: script literal, script variable or script function

The wildcard characters "*" and "?" can be used. "*" stands for any character, "?" for exactly one.

Department

Department of the user who has logged on to the UserInterface and should receive the message.
Format: script literal, script variable or script function

The wildcard characters "*" and "?" can be used. "*" stands for any character, "?" for exactly one.

Message

Message that should be sent.
Format: script literal, script variable or script function

Comments

This script statement can be used to send messages to users. These messages are then displayed in these users' Message Windows.

Because the message can only be supplied to users who are logged on to the UserInterface, Automic recommends using the script element SYS_USER_ALIVE in order to have states checked.

Error "20698" occurs if the indicated user does not exist. Reactions to this error can be defined using the script statement :ON_ERROR and analyzed using the script functions for error handling. Script processing continues but can also be canceled if necessary.

Sent messages are logged and listed in the system control's message category. The message type is "Information" and the message category is "Message".

Note that sent messages can only be displayed if the UserInterface option "Display error messages and warnings only" is not active.

You can use the privilege "View all messages from own client" in order to have messages displayed that are sent to other users.

Examples

User "Brown" from the "IT" departmentDepartment name to which the Automation Engine user belongs. has logged on to the UserInterface and is requested to start the backup routine. A Notification object starts if this user has not logged on.

:SET &RET# = SYS_USER_ALIVE("BROWN","IT")

:
IF &RET# = "Y"
:  
SEND_MSG "BROWN","IT","Please start backup routine!"
:
ELSE
:  
SET &ACTOBJ# = ACTIVATE_UC_OBJECT(CALL,"DAY_SHIFT")
:
ENDIF

In the following example, the user receives the same message as shown in the above example. A script function is used for the department and a script variable for the message.

:SET &MSG# = "Please start backup routine!"  
:
SEND_MSG "BROWN",SYS_USER_DEP(),&MSG#

The next example uses wildcard characters in order to send the message to all users of the IT department .

:SEND_MSG "*","IT","Please start backup routine!"

 

See also:

Script element Description

SYS_USER_ALIVE

Checks whether a user has logged on to AE with a UserInterface.
SEND_MAIL Sends an email to a user.

Script Elements - Error Handling and Messages

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by function