Skip to main content
Omnitracs Knowledge Base

Mark a Message as Seen - OMMKSEEN

Mark a Message as Seen (OMMKSEEN) RI

Required Parameter Group:

1 Global Message Handle Input Packed(9,0)
2 Return Status Output Char(1)
3 Reason Code Output Char(4)
4 Mark All Input Char(1)
5 User Mailbox Input Char(10)

API Overview:
The Mark a Message as Seen API (OMMKSEEN) is used to remove a message from one or more user's unseen list without those users having to actually read the message via the QTRACS User Interface. A call to this API may be placed from some custom external application that has determined that it wants to remove a message from the unseen list of one or more user's message directories.
This API accepts the Global Message Handle of the message to be 'marked', as well as several other parameters that further control how the message should be marked when it is removed from the unseen list(s). The features of this API have been extended over time; therefore, the 4th and 5th parameters to this API are optional. In other words, this API will operate correctly when called with three, four, or five parameters. A caller need only specify the 4th and/or 5th parameter if he chooses to take advantage of the extended features that are controlled by those parameters.
This API will operate on return or local text messages that were received by one or more users. This API will not operate on forward messages, binary messages sent in either direction, or return messages that were received by applications only.

Required Parameter Group Details:
(1) Global Message Handle
INPUT; PACKED(9,0)
This parameter must contain the unique global message handle of a valid text message that:

  1. is return or local (not a forward) message, and
  2. currently exists in the caller's mailbox (or in the optionally specified user's mailbox)

(2) Return Status
OUTPUT; CHAR(1)
Status value returned to the caller will be set as follows:

0 Success, no message marking occurred
1 Failure, no message marking occurred. See reason code.
2 Success, message was marked SEEN
3 Success, message was marked CLMD
4 Success, message was unMARKed
5 Success, message was marked IGND

(3) Reason Code
OUTPUT; CHAR(4)
This parameter contains a reason code. Possible values returned include;

0000 OK
0001 Can't find message header record
0002 Can't lock message header record
0003 Message not in caller's mailbox (or not in the optionally specified user's mailbox)
0004 Can't find message destination record
0005 Message is not return or local
0006 Invalid Mark All parameter
0007 Optionally specified user or address list does not exist
0008 Mark All parameter set to 'Y' and User Identifier has been specified
0009 Mark All parameter must be an 'I' if the User Identifier value is an address list
0010 Warning, specified user not set to ignore messages
0011 Message from a user to a coverage is not eligible for ignoring a message

(4) Mark All
INPUT; CHAR(1)
If specified, this optional input parameter must contain Y, N, or I. If set to Y or I, the API will mark every recipient's copy as SEEN or IGND respectively, rather than just the caller of the API. None of the recipient's copies will be set to CLMD. Calling the API with this flag set to Y or I has the effect of removing the message from all recipients' unseen list.

(5) User Mailbox
INPUT; CHAR(10)
If specified, this optional input parameter must contain a registered QTRACS user or address list. This user or address list must also have received a copy of the message specified by the global message handle parameter. Also, a value of 'N' or 'I' must be specified for the Mark All parameter if a user is specified. If an address list is specified, the Mark All parameter must contain an 'I'.

Possible Implementations
One possible implementation of this API is to call it from a user's homegrown (non-QTRACS) interactive message viewer. When a user views a message from outside of QTRACS, he needs a way to remove the message from his unseen list. This can be achieved by imbedding a call to OMMKSEEN from within his application. In so doing, the QTRACS Message Database is updated the same as if the user had used the QTRACS message display to view his message.

Another possible implementation of this API is to call it from a background external application. This application may handle a message and decide that it wants to 'claim it' or 'ignore it' on behalf of one of the users or a coverage who received the message. This can be achieved by imbedding a call to OMMKSEEN from within the external application. In this instance, the optional PMUSER parameter is specified to indicate for which user or group of users the message should be claimed or ignored. In so doing, the QTRACS Message Database is updated the same as if the specified user had used the QTRACS message display to view his message.
Another possible usage of this API is that it may be called from a user's break message handler

Useful Information

For more information regarding 'break message handlers', see Field Replace Programs - Notification Break Message Handler. Also, a deliverable source OMBRKMSG is available if you want to use and/or modify a site-specific break message handler.

If a user's return message notification is set to *BRKWDW, then a popup window breaks to the user whenever a return message from a vehicle arrives for him. This popup window displays the first five lines of the message. After reading the message, the user may choose to hit F7=Mark Message which would call this API. In this way he would 'mark seen' (or claim) the message without using the actual Message Directory option to display the message.

Effect
A successful call to this API will have one of six effects on the specified message depending upon which parameters are specified on the call.

  1. If PMMARK is not given (or it is given but set to N), and PMUSER is not specified, then the API will 'mark SEEN' (or CLMD, or IGND, etc...) the caller's copy of the specified message.
  2. If PMMARK is specified (and set to Y), and PMUSER is not specified, then the API will 'mark SEEN' every recipient's copy of the specified message. In other words, the message will be removed from everyone's unseen list. This will happen regardless of who called the API and whether or not they are an actual message recipient. Additionally, no user will be set to CLMD or IGND, everyone's copy will simply be marked SEEN.
  3. If PMMARK is specified (and set to I), and PMUSER is not specified, then the API will 'mark IGND' every recipient's copy (providing the user is eligible for ignoring messages) of the specified message. In other words, the message will be removed from everyone's unseen list, unless the user is ineligible for ignoring messages. If the user is ineligible for ignoring messages, the message remains UNSEEN. This will happen regardless of who called the API and whether or not they are an actual message recipient. Additionally, no user will be set to CLMD or SEEN, everyone's copy will simply be marked IGND.
  4. If PMUSER is specified and is a registered QTRACS user (and PMMARK is set to N), then the API will 'mark SEEN' (or CLMD, or IGND, etc...) the specified user's copy of the specified message.
  5. If PMUSER is specified with a registered QTRACS user (and PMMARK is set to I), then the API will 'mark IGND' the specified user's copy of the specified message. The specified user must be eligible for ignoring messages, otherwise the message will remain UNSEEN.
  6. If PMUSER is specified with a registered QTRACS address list (and PMMARK is set to I), then the API will 'mark IGND' every address list recipient's copy of the specified message. The user must be eligible for ignoring messages, otherwise the message will remain UNSEEN.

Another way to understand how this API will operate is to examine the following table. The various permutations of the three input parameters will yield the described results.

PMGMH PMMARK PMUSER Description of the Logic Executed by the API
Non-0 GMH Not Given Not Given The API caller's copy is marked SEEN or CLMD based on his user preference settings .
Non-0 GMH N Not Given The API caller's copy is marked SEEN or CLMD based on his user preference settings .
Non-0 GMH Y Not Given All of the message recipients' copies are marked SEEN regardless of their user preference settings .
Non-0 GMH I Not Given All of the message recipients' copies are marked IGND or left UNSN based on their user preference settings
Non-0 GMH N Given but Blank The API caller's copy is marked SEEN or CLMD based on his user preference settings .
Non-0 GMH Y Given but Blank All of the message recipients' copies are marked SEEN regardless of their user preference settings .
Non-0 GMH I Given but Blank All of the message recipients' copies are marked IGND or left UNSN based on their user preference settings
Non-0 GMH N Valid User The specified user's copy is marked SEEN or CLMD based on his user preference settings .
Non-0 GMH Y Valid User ERROR - A user cannot be specified if PMMARK is set to Y.
Non-0 GMH I Valid User The specified user's copy marked IGND or left UNSN based on his user preference settings
Non-0 GMH N Valid Coverage ERROR - A coverage cannot be specified if PMMARK is set to N.
Non-0 GMH Y Valid Coverage ERROR - A coverage cannot be specified if PMMARK is set to Y.
Non-0 GMH I Valid Coverage Each copy belonging to a member of the specified coverage (address list) is marked IGND or left UNSN based on that member's user preference settings



  • Was this article helpful?