Customer reported that form-level error messages are displayed at both the top and bottom of the harness. From a UI standpoint, customer feels it is a bit odd and they want to show it at the top only. In this post, I will share how we customized it. This tip is applicable to UI-Kit applications.
Steps to reproduce the issue
1. Create a menu that launches a custom harness. Then place a button that refreshes current harness (not section) and run an activity. In the activity, use Page-Set-Messages to add an error message to the page.
2. Now click the button. Against expectations, error message is not shown. Actually, the harness is not even refreshed.
3. This is because Work area checkbox of the harness is not checked (by default, it is not checked). In order for harness to be refreshable, Work area must be checked. Check Work area checkbox as below and save the harness rule.
4. Test again. Now harness is refreshed, and error message is successfully displayed on screen. However, the message appears twice at the top and bottom of the harness. You may feel this is a bit verbose and want to get rid of one (probably the one at the bottom).
* Be noted, if you configure refresh section instead of harness for on click event, this issue won’t happen. This article is only for when the requirement is to refresh harness.
This is an expected behavior. By default, the messages appear in a standard error section at both the top and bottom of user form, as Help indicates below.
If you want to change this to display a message only at the top, you have two options.
(1) "Top of harness" approach
1. From Display options in the harness rule, select "Top of harness" for Form-level errors and save the rule.
@KenshoTsuchihashi Hi Kensho, than you for sharing this guide, that's really helpful. I have one question though, why would default "correct" behaviour show that space between error and section when Top of the harness option is used. For me it looks like a Pega platform defect which should be fixed by a patch instead of being fixed by every customer in customisation of the UserWorkForm. Could you please elaborate with your vision of that?