Class: RuleUtils

FormView~ RuleUtils

Utility class with various helper functions related to rules.


new RuleUtils()

Members


extractFunctionNames

Extract custom functions from form json and return them in the required format.

Methods


<async, static> registerCustomFunctions(formId)

Parameters:
Name Type Description
formId string

The form ID.

Deprecated:
  • Use `registerCustomFunctionsV2` instead. Registers custom functions from clientlibs.

<async, static> registerCustomFunctionsV2(formJson)

Registers custom functions from clientlibs.

Parameters:
Name Type Description
formJson object

The Sling model exporter representation of the form


<async, static> registerCustomFunctionsByUrl(url)

Registers exported custom functions from a given script URL.

Parameters:
Name Type Description
url string

The script URL to load custom functions from.

Throws:
  • If there's an error loading the custom functions from the URL.
Type
Error
Returns:
  • A promise that resolves when the functions are registered.
Type
Promise:.<void:>