Skip to main content

 –

Offline validation API

Suggest edit Updated on November 9, 2021

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 or a custom JavaScript function.

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"); 
        }
Did you find this content helpful? YesNo

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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