Close popover

Table of Contents

Adding validate rules to the allow list for offline use

Improve the user experience and test properties and pages input values of the offline-enabled application against defined conditions by adding a validate rule to the list of offline-supported validate rules. You can use these rules in custom JavaScript code.

A validate rule in an offline-enabled application that is not referenced by a flow rule in the user interface is not packaged, by default. To package additional validate rules for offline use in JavaScript custom code, you must explicitly add validate rule definitions to the pyValidateWhitelistForOffline rule as either the pxInsName string of the validate rule or, if you need to add multiple validate rules, a list of pxInsName strings, each separated by a new line.

The pxInsName string consists of the name of the validate class appended to the validate rule name, separated by an exclamation mark (!). For example, if the class name for the validate rule is MY-VR-SAMPLE-WORK-MYCASE and the validate rule is called SampleVR, the pxInsName string for this validate rule is: MY-VR-SAMPLE-WORK-MYCASE!SampleVR

To add validate rules to the list of offline-supported validate rules, perform the following steps:

  1. In the header of Dev Studio, click Configure Mobile Offline .

  2. In the Whitelist section, on the validate rules line, click Modify whitelist to open the pyValidateWhitelistForOffline rule.

  3. Verify that the pyValidateWhitelistForOffline rule that you are editing belongs to the @baseclass class.

  4. In the HTML source text area, enter either the pxInsName string for a validate rule or a list of pxInsName strings for the validate rules, with each entry separated by a new line.

  5. Click Save.

  • Understanding validate rule support in offline mode

    To improve the user experience, you can use validate rules in offline-enabled applications. For example, a validate rule can test properties and pages input values of the offline-enabled application against conditions that are defined as part of the validate rule. The validation is performed automatically if the rule is referenced by a flow action.

  • Understanding function rule support in offline mode

    You use function rules in online-only applications to define Java methods that run when a function rule is processed. When you develop an application that users can access with an offline-enabled mobile app, the mobile app uses JavaScript-based equivalents of Java-based utility function rules, provided that such equivalents exist.

Have a question? Get answers now.

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