Skip to main content


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

Page-Validate method

Updated on August 16, 2022

Use the Page-Validate method to force validation (or revalidation) of the value of all properties on the step page. The system adds a message to each clipboard property that fails validation against the restrictions in its property.

If the page has hundreds or thousands of properties, this method can be expensive in terms of system resources. The properties on the page already set (through the Property-Set method or similar methods) may already be validated. This method validates them again, and also validates any property values not changed since the page was opened.

Unless the content of the page was altered by Java code or by unorthodox means, the Page-Validate method is not necessary.

Use the Obj-Validate method, not the Page-Validate method, to validate specific properties identified in a Rule-Obj-Validate rule.

A Page-Clear-Messages method applied later to the page removes the messages set by this method.

Parameters

This method has one parameter.

ParameterDescription
WithErrors In most cases, leave cleared. If this check box is not selected and the page identified in the Step Page of this step already contains messages, this method ends. It does not validate properties or create messages.

Select this box to force this method to validate properties even if the page already contains messages.

Results

The system validates each property on the step page against the requirements imposed by that property's definition, such as:

  • Confirming that a definition for the property can be found (in a RuleSet and version available to this requestor), based on the property's name and the class of the page.
  • Confirming that the property value matches the Property Mode and, for Single Value properties, the Type restrictions appropriate for dates, times, numbers, and Boolean values.
  • Checking values against those provided (if any) by the Table fields on the General tab of the property.
  • If the property definition references a property qualifier, confirming that the qualifier value is present and meets its own constraints.
  • Comparing the length of values against the maximum defined in the definition.

This checking happens recursively for embedded pages. If any property fails validation, the system adds a message to the property and to the page.

A property with a null value is considered valid.

When a workstation user submits an HTML form to PRPC, previous page messages corresponding to the input are cleared.

Checking the results

When validation fails, a messages is added to the page. In a transition, use the when condition rule named @baseclass.HasMessages to test for the message. Validation failure does not modify the pxMethodStatus property value.

Restrictions

This method cannot be used in a step that involves an iteration.

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