Discussion

65
Views
TSUCK Member since 2010 126 posts
PEGA
Posted: 2 weeks 2 days ago
Last activity: 2 weeks 1 day ago

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"). Do this step for multiple times.

Page-Set-Messages method to call Message rule

2. Here are the two Message rules that get called.

Message rule 001 Message rule 002

3. Here is how it looks on the end user portal. Two error messages are displayed in a single line rather than two lines.

Error messages shown in a single line

 

  • Variation per version

I've experimented a couple of versions to see how it behaves.

PRPC versionOutcome
7.2

Error messages are displayed in multiple lines (with a line feed).

7.2 error messages

7.3.1

Error messages are displayed in a single line (without a line feed).

7.3.1 error messages

7.4.0

Error messages are displayed in a single lines (without a line feed).

7.4.0 error messages

8.4.1

Error messages are displayed in a single lines (without a line feed).

8.4.1 error messages

8.5.1

Error messages are displayed in a single lines (without a line feed).

8.5.1 error messages

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.

HarnessErrorList

  • 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.

Prepend two asterisk signs in a Message rule

Now, here is the outcome.

Error messages shown in multiple lines

 

* 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,

 

***Edited by Moderator Marissa to add the Developer Knowledge Share tag; add Support Case details***
Pega Platform 7.4 User Interface Developer Knowledge Share SR Exists
Share this page LinkedIn