3 replies Latest Post - ‏2014-04-16T04:08:22Z by CQAdmin
2 Posts

Pinned topic Help to use Expression Tags in EmailPlus Template

‏2014-04-11T22:29:23Z |



One of my customers is trying to generate an EmailPlus template and they get an error on validation of the email template body when trying to use an "Expression tag". They have a record type named "RA" which has a field named "Associated_STR" of type REFERENCE_LIST. The REFERENCE_LIST are records of type STR. In the expression they are able to get the list of STR ids by using the "substitution tag" #?Associated_STR?# which returns a reference to an array. They'd the link to loop of this list and get the "Title" field of each STR record. The script fails to validate:


These fields have invalid values:
Email Template Body...
CRMUD0062E The field "Email Template Body" got a failure from its validation hook. The error message is:
The following substitutions are invalid: EXPRESSION invalid:
use CQPerlExt:
$rc ="";
$sessionobj = $entity ->GetSession();

my $str)ref = [ 'TR00000001' ];
MY @STRS = @{$str_ref};
my $idx = 0;

foreach $str (@strs)
   $rc = $rc , " ",$sessionobj ->GetEntity("STR",

Error: CRMCU0027E An erro was detected retrieving information from
the ClearQuest database.
There is a reference to an object that does not exist:
 Object Type: Entity
 Object: CRMUD0131e "33554433" of the record type "STR"
This error was detect at: ClearQuest Core:adentitymgr.cpp:1002
Recommendation: If you cannot determine how to resolve this issue,
contact Rational Support and provide all the above information as well
as a description of the context in which the message occurred. at (eval
33) line 12.


If they replace the "$str" parameter in the "GetEntity" with a hard-coded value fo a record that exists (e.g., TR00035901) the script validates and the email works.

Please let me know if you see something wrong with the syntax being used, and/or you have any tips to get this working.