Evaluating a template using the TEMPLATE function
Use the TEMPLATE function to set the values of a field to the result of evaluating a template. The TEMPLATE function can appear in a field value in a Push Fields, Set Fields, Open Window, or Service action. The TEMPLATE function returns a text string with values for the parameters included in the template. The template name is always the first parameter, followed by name-value pairs for the remaining parameters, as follows:
TEMPLATE(" templateName", " parameter", " value", " parameter", " value", ...)
Templates can be nested within templates using either of the following methods:
- By using workflow to generate content from a template with an HTML snippet and placing it into a hidden field. The value of that hidden field can be passed to another TEMPLATE function.
- Using the TEMPLATE function as a parameter within another TEMPLATE function.
At runtime, when the client (the mid tier) executes the active link where the template is specified, the template is retrieved from the BMC Remedy AR System server and processed for the parameters that should be substituted. The resulting information is then rendered either in a view field or as a value in a character field.
If the template does not use explicit parameters, it can be evaluated by calling the TEMPLATE function with only the name of the template.
A message action of the type Tooltip can display the HTML generated by a Set Field action. This is typically done using a Set Fields action (generating content into a hidden field), followed by a message action to display the content of the hidden field.
The BMC Remedy Developer Studio Expression Editor includes a mapping tool for setting template parameter values. After you select the TEMPLATE function, select a template from the Template Name list. The explicit parameters are listed in the table below. If you select the Value cell and click the ellipsis button, you can open an editor to set the value. See the following figure.
Entering template information in the Expression Editor
(Click the image to expand it.)