Creating application message objects

Use the Maintain Application Message Objects to create and modify application message objects that can be used in displaying application messages of various types.

For example, suppose that an existing message number MG_100001 has the text "The &1 entered is not valid." You could reuse this message number and text to construct a custom constraint error message.

  1. Open the Maintain Application Message Objects form and execute Filter-In-Place.
  2. Initiate a new message object.
  3. In the Object Name field, specify a name for a SQL constraint.
    Use the rules as specified in the Object Name field description.
  4. Perform one of these actions:
    • If you know the message text you want to display: From the Message Text drop-down list, select an existing message.

      If you perform this action, the Message Num field is automatically populated with the associated message number.

      For example, if you were to select the entry for "&1 must not be between &2 and &3.", then the Message Num field is populated with the value "MG_89".

    • If you know the message number for the message you want to display: From the Message Num field, select the message number.

      If you perform this action, the Message Text field is automatically populated with the associated message text.

      For example, if you were to select the entry for "MG_89", then the Message Text field is populated with the text "&1 must not be between &2 and &3.".

  5. In the Message Desc field, specify a description for how and when the message is intended to be used.
    For example: "Call to a remote method in a DLL"
  6. From the Message Type drop-down list, select the type of message it is.
    For information about the available message types, see Message Type.
    Note:  For any given Object Name, you can have only one Message Type.
  7. From the Object Type drop-down list, select the type of object that the message object is intended to be used with.
    For information about the available object types, see Object Type.
  8. In the Message Severity field, specify the level of severity represented by the message object.
    For information about levels of message severityy, see Message Severity.
  9. Save the record.

    If the Message Type is 5 Standard Message Or Text, you are finished.

    If the Message Type is 17 Constraint Message or 18 Delete Constraint, the Build Messages grid is enabled, where you can specify additional information, according to these guidelines:

    • If the Message Text in the main grid has multiple substitution expressions (&1, &2, and so on), add a row with a Sequence Number corresponding to each of the substitution expressions.
    • To reference the substitution text to use, either select from the Message Num drop-down list a message number; or, optionally, in the Object Name field, select another, existing message object.
    • A message number (Message Num) is always required.

      To indicate that the value in the Object Name field is to be used for the substitution text, select the MG_1 Reserved Message Placeholder option, and then select the desired Object Name.

      If the Message Number is any value other than MG_1, then the application uses that value to look up the message text on the Maintain Application Messages form; and it ignores any value in the Object Name field.

    • The Message Text field displays the text to be displayed in place of the substitution expression.

      If the Message Num is anything other than MG_1, then the text for the selected message number displays. If the Message Num is MG_1 and an Object Name is selected, then the text for the selected message object displays.

  10. Save the record again.
  11. Optionally, if your company uses source code control, click Generate Message Script File. Then, in the Generate Application Messages Script form, specify the appropriate file path and filter information, and click Generate SQL Script File.