Skip to main content


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

Property-Validate method

Updated on August 10, 2022

Use the Property-Validate method in an activity to ensure that a property value meets certain requirements including:

  • Checking performed by an edit validate rule ( Rule-Edit-Validate rule type)
  • A requirement that a property have a non-null value

You can also provide default values for properties.

If your planned activity can consist entirely of Property-Validate methods, you don't need to create an activity. Create a validate rule ( Rule-Obj-Validate ) instead.

Parameters

This method has an array of parameters, seven per row.

ParameterDescription
PropertyNameEnter a property reference, identifying the property to be validated.
ValidateAsOptional. Identify a literal key to an edit validate rule, or enter an expression that returns true or false when applied to the property. If left blank, the edit validate rule referenced in the property itself (if any) is used.
Continue

Select the box to cause the processing of this method to continue after a validation error. Clear the box to cause this method to stop after one validation error is found.

Default Optional. Provide a value to set if the property identified in the PropertyName column of this row has no value.
Required Select the box to require that the property has a non-blank value. If selected and the property value is blank, the system associates the message
This field may not be blank.

with the property.

You cannot override this message text. The value in the ErrorMessage parameter does not override this message.

ErrorMessage Optional. Enter a text string for the message created if the rule defined in the ValidateAs parameter fails. If you leave this blank, the system uses a generic message.

This text is not used when the Required box is selected.

OnlyIfChangedLeave cleared. Not used.

Results

The system validates the properties identified in the first column one by one, starting with the first row. It stops when all rows are evaluated, or when a property fails validation and the Continue check box for that row is not selected.

A property fails validation if the edit validate rule returns false, or if the Required parameter is selected but the property is missing or has a blank (null) value. When a property fails validation, the system adds a message to the clipboard page. Ordinarily, pages that contain messages (indicating errors) are not saved into the PegaRULES database.

Checking the method status

This method updates the pxMethodStatus property. See How to test method results using a transition.

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