About Application Message Construction

Use application messages to display these types of information:

NOTE: The types of application messages described here are generated through application database code (stored procedures, triggers, etc.) and/or in the IDO layer (IDO custom assemblies, etc.). Messages that are generated at the client are not applicable here and do not reference or use the messages that are contained in these  Application tables.  

Application messages are stored in the system and are invoked in response to user or system operations. Messages can be constructed with both literal strings and variable values substituted and inserted into the message when it is invoked.

Messages are identified and invoked with a unique message number that is assigned to the message when it is constructed.

Setting Message Numbers

Typically, the unique message number  consists of an alphanumeric prefix that identifies the application or its owner, followed by an autonumbered suffix that is created and applied when the message is constructed. You are not required to follow this model, but it provides the best way to identify and locate messages.

For example, your organization is called WonderWare, and you have an application called IssueTrack. You can create and designate a message number prefix like "WW-IssTr-" to identify all messages used in conjunction with this application. If you add an autonumbering suffix to this, you can then create messages for your application without worrying about maintaining unique message numbers. Using this process also allows you to locate all messages designed for use with this application.

To create this type of message numbering:

  1. Use the Message Num Prefix field on the General Parameters form to specify the prefix. The system uses the prefix automatically when messages are created.
  2. Use the Maintain Application Messages form to construct the message.

    For information about constructing messages, see the next section.

    The Message Num column on this form is defined as a TBD (To Be Determined) field, which means that, when you create a message and save it, the system automatically uses the prefix and assigns the next available number as the suffix.

  3. Continuing our example, when you create your first application message, the system automatically assigns the message number "WW-IssTr-1" to it. The next message is created as "WW-IssTr-2" and so on.

    Note: Predefined core messages assigned to and used by Mongoose have the prefix "MG_". Other Mongoose-based applications might have and use other prefixes; for example, "SL_" for SyteLine-related messages, "SM_" for Service Management-related messages, and so on.

  4. Save the message.

Constructing Messages

A message can be constructed in such a way that values of various parameters can be picked up and used dynamically when the message is invoked. This is done with the use of substitution parameters that are evaluated when the message is invoked and run-time values substituted for the parameters.

These substitution parameters are indicated in a message by the use of an ampersand (&) followed by a number or letter. Examples: &5 and &C

Possible sources of values for these substitution parameters include:

When constructing a message with substitution parameters, make sure the code that invokes the message contains the correct number of values for the substitutions.

To invoke the message at run-time, insert an expression into your code at the point where you want to call the message. This expression must use the MESSAGE parameter function.

Example: The message E=NoExistForIs5 has the value in English: "There exists no &1 where &2 is &3 for &4 that has [&5: &6] and [&7: &8] and [&9: &A] and [&B: &C] and [&D: &E]."

This message requires 14 parameters as follows:

An example of a call for this message might look like this:

MESSAGE("E=NoExistforIs5", "@serial", "@serial.ser_num", V(SerNum)
    , "@item"
    , "@serial.whse", V(Whse)
    , "@serial.item", V(Item)
    , "@serial.loc", V(Loc)
    , "@serial.lot", V(Lot)
    , "@rsvd_inv.import_doc_id", V(ImportDocId)
    )

At action execution time, this might evaluate to the following string:

There exists no Serial Number where S/N is S/N1234 for Item that has [Whse: MAIN] and [Item: BK-27000-0007] and [Location: STOCK] and [Lot: LOT00012345] and [Import Doc Id: DocId000123456].

Invoking and Concatenating Multiple Messages

You can construct calls to display multiple messages simultaneously. To do this, use multiple MESSAGE expressions separated by pipe ( | ) symbols. The pipe symbol concatenates the messages.

Example: Consider the following MESSAGE expressions:
MESSAGE("E=NoExistforIs5", "@serial", "@serial.ser_num", V(SerNum)
    , "@item"
    , "@serial.whse", V(Whse)
    , "@serial.item", V(Item)
    , "@serial.loc", V(Loc)
    , "@serial.lot", V(Lot)
    , "@rsvd_inv.import_doc_id", V(ImportDocId)
    )
   | MESSAGE("E=AppLockFail3")

At run time, this concatenation might evaluate to this message conversation:

There exists no Serial Number where S/N is S/N1234 for Item that has [Whse: MAIN] and [Item: BK-27000-0007] and [Location: STOCK] and [Lot: LOT00012345] and [Import Doc Id: DocId000123456].

Lock request was chosen as a deadlock victim.


Related Topics

Maintain Application Messages form

MESSAGE, Event Parameter Functions

General Parameters form