AddRecipient method: PSEvent class

Syntax

AddRecipient(name, type)

Description

Use the AddRecipient method to set a specific recipient to receive the notification. Either a user ID or a role name can be specified, but not both.

Note:

If no recipients are set for a notification, all the users who have subscribed for that notification will receive the notification.

Parameters

Parameter Description

name

A string representing the name of the recipient (user ID or role name).

type

A number representing the type of the recipient:

  • 1 — If the name parameter represents a user ID.

  • 2 — If the name parameter represents a role name.

Returns

A Boolean value: True if the method completes successfully, False otherwise.

Example

The following example sets the user PTUSER as the recipient.

&name = "PTUSER";
&EventObject.AddRecipient(&name, 1);