Discussion
Pegasystems Inc.
JP
Last activity: 12 Sep 2023 14:39 EDT
How to fix multiple error messages shown in a single line issue
Hi,
Recently customer has upgraded their application which was built on Pega 7.3.1 to 8.4.1, and this issue was reported to me. In this post, I am sharing its details and workaround for someone who may face the same issue.
- Issue
Some of the version of Pega Platform displays multiple error messages that are triggered by Page-Set-Messages method in a single line. Below is the customer's code to reproduce the issue.
1. Write an activity and call Page-Set-Messages method. Then reference Message rule by RUF. Synatax is, @getRuleMessage(tools,"Error001"). Also make sure "Category" is blank or behavior may change depending on version. Do this step for multiple times.
2. Here are the two Message rules that get called.
3. Here is how it looks on the end user portal. Two error messages are displayed in a single line. Customer's expectation is two lines.
- Variation per version
I've experimented a couple of versions to see how it behaves.
PRPC version | Outcome |
---|---|
7.2 |
Error messages are displayed in multiple lines (with a line feed). |
7.3.1 |
Error messages are displayed in multiple lines (with a line feed). |
7.4.0 |
Error messages are displayed in a single lines (without a line feed). |
8.4.1 |
Error messages are displayed in a single lines (without a line feed). |
8.5.1 |
Error messages are displayed in a single lines (without a line feed). |
Per my experiment, prior to 7.3, error messages were displayed in multiple lines. Specification has been changed from 7.4 onwards. Internally, two asterisk signs are prepended and below @baseclass.HarnessErrorList section will use it for processing.
- Workaround
Actually, this issue was reported through a couple of SRs in the past, and has been part of the product for a considerable amount of time. However, the enhancement is not incorporated to the product yet and timeframe is unknown. So realistically I would recommend to perform a local change if you face the same issue. Workaround is, to prepend two asterisk signs in the Message rule as below.
Now, here is the outcome.
* Be noted if you are calling the same Message rule from Property-Set-Messages method as well, asterisk signs will be still displayed. If this workaround conflicts customer's expectation, do Save As to create a separate Message rule excluding asterisk signs for Property-Set-Messages method.
Thanks,