Use of Tokens in Messages

Certain messages must display variable information at run time to help users clearly relate to the actual data and perform the required action.

Instead of writing a unique message for every possible situation, you can use tokens to display the variable values at run time.

Tokens are programmatic parts of message text that are placed within curly brackets when creating the message. Tokens serve as placeholders for the actual data. At run time, tokens dynamically display the actual text or value in the message, making a message specific to the situation. For example, the message "Enter an effective date that's the same as or later than {MATURITY_DATE}" contains the token {MATURITY_DATE}. At run time, instead of the token, the represented value (the actual date) appears. Thus, users see the message "Enter an effective date that's the same as or later than 25-APR-2015".

Use the Manage Messages task in the Setup and Maintenance work area to create and manage tokens. You must edit a message to define tokens for it. You can create tokens for a message and also delete them. However, you can't edit or delete the predefined tokens.

Token Definition

To define a token, you must provide the following information:

  • A unique name for the token.

  • The type of data that the token replaces at run time. Available types are Date, Number, or Text.

  • A description about what the token represents at run time.

Guidelines

Follow these general guidelines while defining tokens:

  • Use curly brackets and all uppercase letters for the token names.

  • Use underscore as a separator for a name containing two words or more.

  • Don't use a space between words.

The following table contains specific guidelines for each token data type.

Data Type

Guideline

Text

Use tokens for substituting any variable text element that qualifies as a noun.

Number

Plan carefully while using tokens for numbers especially, where a token could refer to either a singular or a plural number. You can use tokens for numbers representing an order, customer, or any other business object bearing a numeric value.

Date

Clearly define the context of the date, such as the start date, or end date, or a date range.