Kernel 8.0 APIs Banner [skip navigation]
Office of Information & Technology (OIT) Banner

FORWARD^XQALFWD(): Forward Alerts

Reference Type: Supported, Category: Alerts, Integration Agreement: 3009

Description

This API can be used to forward alerts (in most cases, for the current user only). It is a silent (no screen input or output) API, and so can be used for windowed applications.

Format

  FORWARD^XQALFWD([.]alerts,[.]users,type[,comment])

Input Parameters

[.]alerts:

(required) Array of alerts to be forwarded, each identified by its full alert identifier (the value of the ALERT ID field in the ALERT DATE/TIME multiple of the current user's entry in the ALERT file (#8992)). Use the USER^XQALERT(): Get Alerts for a User API to obtain alert identifiers for a user's current open alerts.

If only a single alert is to be forwarded, only the top node must be set (set it to the alert identifier of the alert to forward, and pass by value). If there are multiple alerts to forward, the value of each entry in the array should be one of the desired alert identifier. For example:

A6AALRT(1)="NO-ID;92;2941215.100432"

A6AALRT(2)="NO-ID;161;2941220.111907"

A6AALRT(3)="NO-ID;161;2941220.132401"

If using an array, the array must be passed by reference in the parameter list.

[.]users:

(required) Users to forward alert to. For forwarding as an alert or as a mail message (when the type parameter is A or M), the input parameter can specify one or more users, and/or mail groups. For users, specify by IEN (in the NEW PERSON file [#200]). You do not need to precede the user's IEN with an accent grave. For mail groups, specify in format G.MAILGROUP.

If there is only a single user or mail group, just set the top node of the array to that value, and pass it by value. If there are multiple values to be passed, pass them as the values of numerically subscripted array nodes (and pass the array by reference). For example:

A6AUSER(1)="G.MAS CLERKS"

A6AUSER(2)="G.MAS OVERNIGHT"

For forwarding to a printer (when the type parameter is P), there should be only a single value specifying the desired entry in the DEVICE file (#3.5). You can specify the device either by name or by Internal Entry Number (IEN). If specifying by IEN, precede the IEN with an accent grave (e.g., `202).

type:

(required) Indicates the method of forwarding desired. The options are the single characters "A" (to forward as an Alert), "M" (to forward as a Mail Message), and "P" (to print a copy of the alert). If the value passed is not either A, M, or P, then no action will be taken.

comment:

(optional) A character string to use as a comment to accompany the alert when it is forwarded.

Output

none

 

Example

; get open alerts for current user
K A6AALRT D USER^XQALERT("A6AALRT")
;
I +A6AALRT D  ; if any current alerts...
.; loop through A6AALRT array, parse alert id for each open alert
.K A6AALRT1 S A6ASUB="",A6AI=0
.F  S A6ASUB=$O(A6AALRT(A6ASUB)) Q:'$L(A6ASUB)  D
..S A6AI=A6AI+1,A6AALRT1(A6AI)=$P(A6AALRT(A6ASUB),"^",2)
.;
.;forward open alerts of current user to MAS CLERKS mail group
.K A6AUSER S A6AUSER="G.MAS CLERKS"
.D FORWARD^XQALFWD(.A6AALRT1,A6AUSER,"A","Forwarded Alert")
Q

 


VA (Internet) / VA(Intranet) / OI / PD / Site Map / Terms of Use / VA Privacy Policy / Accessibility

Reviewed/Updated: August 26, 2011

If you have questions, need more information, or are having accessibility problems with this website, please contact us by E-Mail: Webmasters, Phone: 510-768-6800, or FAX: 510-768-6850.