AddRecipients method: PSEvent class

Syntax

AddRecipients(names, type)

Description

Use the AddRecipients method to set multiple recipients to receive the notification. Either user IDs or a role names can be specified, but not both.

Parameters

Parameter Description

names

A string array representing the name of the recipients (either user IDs or role names).

type

A number representing the type of the recipients:

  • 1 — If the names parameter represents user IDs.

  • 2 — If the names parameter represents role names.

Returns

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

Example

The following example sets an array of user IDs as the recipients.

Local array of string &USERIDS;
Local string &ROLENAME;

&ROLENAME = "Portal Administrator";
Local Rowset &rs = CreateRowset(Record.PSROLEUSER);
&rs.Fill("WHERE ROLENAME=:1", &ROLENAME);
&USERIDS = CreateArrayRept("", 0);
For &i = 1 To &rs.RowCount
   &USERIDS.Push(&rs(&i).PSROLEUSER.ROLEUSER.Value);
End-For;

&EventObject.AddRecipients(&USERIDS, 1);