Table of Contents

Article

How to create a custom error section in user forms (6.2)

Summary

User forms display, by default, a standard section containing error messages when form-level errors occur. This article describes how to create a custom error section and display it when form or field-level messages occur. You can use your custom section to override the standard section, or display both sections at the same time.

Also described is how to use the Branding wizard to apply styles to the contents of your custom section.

For information about:

– Applying styles to error messages in 6.2+, see How to apply styles to user form error messages using the Branding wizard (6.2).

– Creating custom error sections and applying styles to field-level error messages in V5.X, see How to customize the presentation of errors on work object forms.

 

Suggested Approach

In this example, you will configure a section instructing users who to contact if they are unable to resolve any errors on the form. You want the message to appear for both form and field-level errors.

  1. Open the harness you want to add the error section to.
  2. On the Display Options tab. select In Configurable Section in the Display Form-Level Errors field.
  3. Select the Always show form level errors checkbox.
  4. In the Custom Error Section field, select or create a section rule that will display the error message.



    Important: When you select this option, the custom error section overrides the standard section — the standard section will not appear. Therefore, make sure that you add your section to the harness layout as described below. Otherwise, noform-level error messages will appear.
    If you want to display both the custom and standard sections, perform steps 1 through 4, and change the option to  Default or Top of harness.
  5. On the custom section's Layout tab, add one or more label fields in a layout, and enter the message text as shown in this example::

  6. Save the section and include it on the harness in the desired location.
  7. Open the Section Include properties panel.
  8. On the General tab, in the Visible When field, select hasMessages from @baseclass, and click OK.

To apply styles to the message, do the following:

  1. Open the Branding wizard from > User Interface > Branding Wizard.
  2. In the Name and Location panel, select modify an existing skin and an unlocked version of the skin you are modifying. Make sure that it is selected in your Designer Studio General Preferences dialog so that you can view your modifications during testing.
  3. Navigate to the Custom panel.
  4. Add a row ( ), and enter a name in the Style Name column.
  5. Open the Style Editor ( ) and enter your settings.



  6. Click Save to close the Editor.
  7. Click Save in the wizard, and leave it open for testing.
  8. Return to the custom section in the harness.
  9. Select the cell containing the message, open its Properties panel, and enter the style name in the Read-Write Style field on the Advanced tab.

  10. Save the harness and run your process to test.

Published August 18, 2011 — Updated September 29, 2011

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.