IBM Support

Unable to use bind variables in Communication Templates

Troubleshooting


Problem

When trying to use bind variables such as :&PERSONID& and :&DATE& within communication templates. The problem is that the template seems to ignore the variables and just prints out ":&PERSONID&" instead of the real value.

Cause

The RTE (Rich Text Editor) is saving special bind variables of the form :&VARIABLE& as :&VARIABLE&. This is causing the variables to not be recognized & replaced by their values in emails.

Diagnosing The Problem

The following steps have been used to reproduce the problem:


1. Go to Communication template --> create a new template called BIND VARIABLES
Applies to SR
Put an email address in Send From field
In the message field --> enter :&PERSONID&
It resolves to the person id of the current logged in user.

:&USERNAME&
It resolves to the current log in user name.

2. Click on Recipients tab --> E-mail(s) for Communication Template --> Enter your email address and check the box To

3. Save the change and make it ACTIVE

4. Go to SR and create a new SR or pick up an existing one

5. Click on Select Action --> Create a communication --> choose the one you created

At this stage in the message field, Maximo displays the bind variables rather than the value.

6. Click on SEND - You will get a mail with bind variables and not value you expected for current logged in user. But we noticed that bind variables without & seems to work fine.

Resolving The Problem

Scripting can be used to resolve this: See below example using Automation Scripting.

1. Create some dummy attributes whose names correspond to the desired information in the object (say SR):

dummy attributes



Instead of :&DATE&, etc. add these attributes to the communications template (applies to SR):

Create a script with an Object launch point (SR) to get the desired information from the Mbo or MXServer.

step 1

step 2

step3



[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Comm Templates","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SSWT9A","label":"IBM Control Desk"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SS2H8H","label":"Tivoli Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SSZRHJ","label":"IBM Control Desk on Cloud"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg21682207