Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Creating a custom message category

Updated on January 14, 2022

You can extend the standard categories for messages. By defining custom categories, you can create and classify messages in a way that is specific to your business.

  1. Create a field value for your custom category.

    1. Click CreateData ModelField Value to open the Create form.

    2. In the Label field, enter [custom category name].

    3. In the Field Name field, enter pyCategory.

    4. In the Apply to field, enter Rule-Message.

    5. Click Create and open.

  2. Create a field value for the caption of your custom category.

    1. Click CreateData ModelField Value to open the Create form.

    2. In the Label field, enter [custom category name].

    3. In the Field Name field, enter pyCaption.

    4. In the Apply to field, enter Rule-Message.

    5. Click Create and open.

  3. To prompt users for more input when they select your custom category, create a custom section.
    1. Find and open the standard Rule-Message.pyCustomDetails section by searching for it or by using the Application Explorer.

    2. Click Save as > Specialize by circumstance to open the Specialization form.

    3. Click Property and Date.

    4. In the Property field, enter pyCategory.

    5. In the Value field, enter the name of your custom category.

    6. Click Create and open to open the Section form.

    7. Update the section with references to properties in the Rule-Message class, so that it collects information that is relevant to your custom category.

      For example, you can add a text box to a layout in the section and then associate it with a property that stores text.

    8. Click Save.

  4. To validate the values that users provide at run time, create validation logic that is specific to your custom category.
    1. Find and open the standard Rule-Message.pyValidateFields edit validate rule by searching for it or by using the Application Explorer.

    2. Click Save as > Specialize by circumstance to open the Specialization form.

    3. Click Property and Date.

    4. In the Property field, enter pyCategory.

    5. In the Value field, enter the name of your custom category.

    6. Click Create and open to open the Edit Validate form.

    7. Add criteria to the rule that evaluates the properties that your custom section references.

    8. Click Save.

You can test your changes by creating a message and verifying that your custom category is one of the available options.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us