Skip to main content
Omnitracs Knowledge Base

Background Selection of Message Destinations - OMSELECT

Background Selection of Message Destinations (OMSELECT)

Required Parameter Group:

1

Create Message Block

Input

Char(4174)

2

Return Status

Output

Char(1)

API Overview:
This is a customizable site-specific program whose source resides in the deliverable source library, OMNIDLVSRC. All site-specific programs should be compiled into the site library, OMNISITE.

The Background Selection of Message Destinations API (OMSELECT) provides a mechanism for the customer to auto-select the destination(s) for certain forward macro messages created from the QTRACS User Interface.

Specifically, this program is called by the Create Message UI during forward message creation when a user presses Enter to transmit the message. If the user has keyed *SELECT as the destination, then this program will be called. It is envisioned that, in some cases, the user will not know to whom he wants to address a message, but that he will know how to describe the recipient(s). The purpose of this feature is to provide a means to allow some background task to programmatically determine the recipients of a message, and then send the message.

For example, a user may want to send a message to all trucks eligible to pickup a load in a certain city on a certain date. He doesn't know which trucks meet those requirements, but he has a program that will figure it out. Therefore, OMSELECT could be modified to prompt the user for any selection criteria necessary to determine the recipients. Then, that information could be passed to a background task (via SBMJOB, a queue interface, etc.) which would cull the database to determine the recipients. After the recipients are determined, the background task must send the message via a call to the Create Message API (OMCRTMSG). Except for the Message Destination, all of the parameters necessary to satisfy a call to OMCRTMSG are passed to OMSELECT.

Required Parameter Group Details:
(1) Macro Number
INPUT; PACKED(3,0)
This parameter is a fixed format data structure that contains all (except the message destination) of the parameters necessary to satisfy a call to OMCRTMSG. These parameters were specified by what the user keyed on the Create Message UI.
Refer to the Create Message API documentation for a description of this data structure.

(2) Return Status
OUTPUT; CHAR(1)
Status value returned to the Create Message UI.

0

Success, message request submitted

1

Failure, message request cancelled by user

2

Failure, message request not submitted

Effect
This program will not normally exist at a customer site because it is not delivered as an object. It will only exist if the customer decides to make use of this feature. If the program does not exist, then the Create Message UI will not allow *SELECT to be keyed as the message destination.

Alternately, if the customer decides to make use of this program, it should be modified to suit and compiled into the site-specific library. The Create Message UI will automatically detect it and call it each time a forward message is created with *SELECT as the message destination. When *SELECT is used, the Indirect indicator will not be applicable and the message will be created with no indirection.

  • Was this article helpful?