Skip to main content


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

Offline validation API

Updated on February 23, 2022

The offline validation API consists of a JavaScript method that runs a validate rule in offline-enabled mobile apps by using a Run script action.

Offline validation is possible with the runValidate JavaScript method that is available for the pega.offline object. You can run the following rules with this method:

  • Validate rules that are referenced in flow actions
  • Validate rules that you add to the list of offline-supported validate rules

Purpose

Runs a validate rule in offline mode with the specified name and class.

Signature

runValidate( validateName, className )

Returns

Returns a Boolean value that specifies whether the validation was successful (true) or not (false). The method also adds messages to properties for which the validation rule failed.

Parameters

NameDescriptionTypeRequired
validateNameSpecifies the name of the validate rule to run.String
classNameSpecifies the name of the class that the validate rule belongs to.String
For example:

In the following example, JavaScript code runs a pzValidateMeetingTime validate rule of the PEGA-MANAGEMENT-MEETING class.

if ( !pega.offline.runValidate( "pzValidateMeetingTime", 
        "PEGA-MANAGEMENT-MEETING" ) ) {
        console.log("Meeting cannot be set up in the past"); 
        }

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