Print Page as PDF
ADDRESSING API ICR (10067)

ADDRESSING API    ICR (10067)

Name Value
NUMBER 10067
IA # 10067
DATE CREATED 1995/02/07
CUSTODIAL PACKAGE MAILMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XMA21
NAME ADDRESSING API
ORIGINAL NUMBER 10067
GENERAL DESCRIPTION
This routine has four APIs to perform address lookup.
They are generally used to address messages and bulletins.  Compare them to
TOWHOM^XMXAPI (DBIA 2729) and TOWHOM^XMXAPIU (DBIA 2774).

DEST^XMA21  Perform an interactive recipient lookup showing XMDUN
as the default for the FIRST recipient

DES^XMA21   Perform an interactive recipient lookup showing XMMG
as the default for the NEXT recipient

WHO^XMA21   Perform a non-interactive recipient lookup if X is a
local name or network address.

INST^XMA21  Same as WHO^XMA21.

This one has nothing to do with addressing:

CHK^XMA21   Check to see if a user is a member of a mail group.
STATUS Active
ID XMA21
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
DES
Perform an interactive recipient lookup, showing XMMG
as the default for the NEXT recipient.

The user is prompted for a recipient, with XMMG as the next default recipient.
The prompting will continue until the user has finished entering recipients.
The recipients are placed in the array XMY.  Unlike DEST^XMA21, the array XMY
is not killed upon entry to this API.  (It is assumed that XMY already
contains some valid recipients.)

Compare to TOWHOM^XMXAPIU (DBIA 2774).

Usage: S XMDUZ=user's DUZ
S XMMG=next default recipient
S XMDF="" (if you don't want any addressing restrictions)
D DES^XMA21
I $D(XMOUT) the user aborted
VARIABLES TYPE VARIABLES DESCRIPTION
XMDUZ Input
DUZ of the user doing the addressing.
XMMG Used
(optional) Name or DUZ of the NEXT default recipient
to present to the user.  If not supplied, default is XMDUZ.
XMDF Used
(optional) If $D(XMDF), then all addressing
restrictions are waived.
XMY Output
Array of recipients chosen by the user.  Any
recipients already in the array prior to the call will still be there after
the call.

XMY(addressee)=""
XMOUT Output
If $D(XMOUT), then the user aborted addressing,
either by ^ or by time-out.
X Output
If X="^", then the user aborted addressing, either by
^, or by time-out.  Otherwise, X="".

Just ignore this variable and rely on checking XMOUT.
INST
Perform a non-interactive recipient lookup.

The recipient (in X) is looked up.  If the lookup is successful, the recipient
is placed in the array XMY.  The array XMY is not killed upon entry to this
API.

Compare to TOWHOM^XMXAPI (DBIA 2729).

Usage: S XMDUZ=user's DUZ
S X=recipient
S XMDF="" (if you don't want any addressing restrictions)
S XMLOC="" (if you want any error to be written to the output device)
D INST^XMA21

If the call succeeds,
Y=addressee info
XMY(addressee)=""
XMMG=other addressee info

If the call fails,
Y=-1
XMMG=error message
VARIABLES TYPE VARIABLES DESCRIPTION
XMDUZ Used
(optional) DUZ of the user doing the addressing.
Default is DUZ.
X Input
local or remote address
XMDF Used
If $D(XMDF), all addressing restrictions are waived.
XMLOC Used
If $D(XMLOC), any error (in XMMG) is written to the
output device.
XMY Output
If lookup is successful, the addressee is placed in
array XMY.  The array is not killed upon entry to this call, so anything
already in XMY prior to the call will still be there after the call.

XMY(addressee)=""
Y Output
If the lookup is successful, Y is
for a local address:   DUZ^full name
for a remote address:  domain IEN^domain name

If the lookup fails, Y=-1.
XMMG Output
If the lookup is successful, XMMG is
for a local address:   ""
for a remote address:  "via "_full domain name via which the message will be
routed.

If the lookup fails, XMMG contains an error message suitable for printing.
(If $D(XMLOC), it will be printed.)
WHO
This entry point is identical to INST^XMA21.
DEST
Perform an interactive recipient lookup, showing
XMDUN as the default for the FIRST recipient.

The user is prompted for a recipient, with XMDUN as the first default
recipient.  The prompting will continue until the user has finished entering
recipients.  The recipients are placed in the array XMY.  Unlike DES^XMA21,
the array XMY is killed upon entry to this API.

Compare to TOWHOM^XMXAPIU (DBIA 2774).

Usage: S XMDUZ=user's DUZ
S XMDUN=first default recipient
S XMDF="" (if you don't want any addressing restrictions)
D DEST^XMA21
I $D(XMOUT) the user aborted
VARIABLES TYPE VARIABLES DESCRIPTION
XMDUZ Input
DUZ of the user doing the addressing.
XMDUN Used
The name or DUZ of the first default recipient.  If
not supplied, default is XMDUZ.
XMDF Used
If $D(XMDF), then all addressing restrictions are
waived.
XMY Output
Array of recipients chosen by the user.  The array is
killed upon entry to the API, so any recipients already in the array prior to
the call are gone.

XMY(addressee)=""
XMOUT Output
If $D(XMOUT), then the user aborted addressing,
either by ^ or by time-out.
X Output
If X="^", then the user aborted addressing, either by
^, or by time-out.  Otherwise, X="".

Just ignore this variable and rely on checking XMOUT.
CHK
Check to see whether XMDUZ is a member of group Y.

Example:

>S Y=1,XMDUZ=4 D CHK^XMA21 W $T
0  (User is not a member.)

>S Y=2,XMDUZ=4 D CHK^XMA21 W $T
1  (User is a member.)
VARIABLES TYPE VARIABLES DESCRIPTION
XMDUZ Input
DUZ of the user whose group membership you wish to
check.
Y Input
IEN of the mail group in the MAIL GROUP file (#3.8)
whose membership you wish to check.
$T Output
If $T, then the user is a member; otherwise not.