Reference manual

Text Constants

The Text Constants window finds the text constant (TextConst) declarations whose text matches a pattern. Use it to get from a message a user saw to the code that shows it.

Opening Text Constants

The Text Constants window

Prism for C/AL Text Constants window with results for an error message pattern
1 2 3 4 5 6 7 8 9
Text constants that match part of an error message.
#NameDescription
1Search boxThe pattern to find; see Pattern syntax. Press Enter to search.
2SearchStarts the search.
3All objectsSearches every object in the store.
4Currently filtered objectsSearches the objects the object index shows.
5CountThe number of text constants found.
6Copy Results to ClipboardCopies the results as tab-separated text with the columns Object and Name.
7Collapse allCollapses every node.
8Expand allExpands every node.
9ResultsObjects and, under each, the matching text constants. The object of the top row stays pinned while you scroll. Select a constant, or double-click it, to go to its declaration in the workspace window.

Pattern syntax

TextMatches
*Any run of characters, including none.
?Any single character.
Anything elseItself, ignoring case.

The pattern matches anywhere in each language value of a constant. The language prefix, such as ENU=, is not part of the value, so a pattern in any language the constant holds finds it.

Find the code behind an error message

Use this when a user reports an error message and you need the code that raises it.

  1. Choose Search › Text Constants by Content….
  2. Type the fixed words of the message, with * where it shows values. The constant holds placeholders such as %1 where the message shows values. For example, for "You cannot create this type of document when Vendor 12345 is blocked with type Payment", type you cannot*this type of document when *is*.
  3. Press Enter and select the constant in the results to go to its declaration.
  4. Right-click the constant in the object view and choose Find Usages to list the code that uses it.

A message that is not in a text constant, such as one written straight into an ERROR call, is found with Find a message written into code.

Behavior

  • Window title: Search Text Constant Contents after the product name, also shown as the window's heading.
  • No cancel: a search runs to the end; the window has no Cancel button.
  • Background task: the search also shows among the workspace window's background tasks.