Using the Recipient() MetaScript Object

Using the Recipient() MetaScript Object

 

One powerful tool for restricting recipients of a notification is the "Recipient()" MetaScript object. By using this object, you can automatically limit the recipients of a notification to the user(s) selected in the form for the folder type/document type which the notification has been created.

For example, suppose you have a group of 10 users defined as recipients of a notification, but you only want the notification to go to the user specified on the form when the form is updated. The Recipient() MetaScript object can be used to achieve this. By using the Recipient() MetaScript object in an Additional restrictions on recipients condition, the notification will be sent only to the indicated user, and not to the remaining nine users assigned as recipients for the Notification.

A Warning about using the MetaScript Recipient() Object

The Recipient() MetaScript object compares the name (or ID or Employee Number) of the employee recorded in the corresponding field on the record with all the users selected as recipients in the notification routine. The notification is sent only to the user whose name (or ID or Employee Number) matches the name (or ID or Employee Number) indicated on the record. The user name (or ID or Employee Number) can be typed manually into the field, selected from a popup list of users, or populated according to other MetaScript methods. Be aware, however (especially if the user name is manually typed) that for the notification to work properly, the user name (or ID or Employee Number) in the form MUST correspond to a user selected as a recipient of a notification. If a user name (or ID or Employee Number) is entered on the form that does not correspond to a user selected as a recipient, the notification will not be sent.

Because of the potential for incorrect information to be entered by users, and the ensuing possibility that the notification will not be sent, it is worth considering implementing the ability to select users on the form from a popup list that is programmatically populated with available users.

The full Recipient() MetaScript object used in for implementing additional restrictions on recipients must be of a valid type that corresponds to how the user is indicated in the record (ie: by login name, first name, last name, etc...).

Permitted Recipient() Objects

The following Recipient() MetaScript objects are available for use when creating conditions used for implementing additional restrictions on recipients:

Recipient().Name

Recipient().FirstName

Recipient().LastName

Recipient().ID

Recipient().EmployeeNumber


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.