Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The validations section appears at the bottom of the Type dialog.Image Removed

...

Validation Option

Description

Regex

Providing a valid regular expression in this field will cause the platform to evaluate the input value when the form is submitted.  If the regular expression test fails, the Value State of the control will be set to Error and the Value State Message will be set to "Invalid entry" or whatever text has been provided in the Error Msg property.

As of FAB

IQX Fiori App Builder has pre-built choice of regular expressions as follow:

image-20240723-002948.pngImage Added

The entire Project App is saved as an XML file, ready for export or import to other systems. Therefore, any entered Regular Expression will be included in this XML file.

Starting with FAB version 3.3.2

version

, a Validate button is

now

available

for checking

to check the validity of Regex. This validation ensures that:

  1. The regular expression follows standard RegEx syntax.

  2. It contains characters that can be translated into XML properly.

If the regular expression passes these checks, an informational popup saying below message is displayed.

image-20240725-075716.pngImage Added

Otherwise, this message appears.

image-20240725-075914.pngImage Added

All RegEx ↔︎ XML translation is now done on back-end and no user action is needed. To view this translation, user may right-click on the element and choose “Show XML”.

Here is an example of translated regular expression in XML:

Entered RegEx: ^[.\+*?^$()\[\]{}<>&'"`~!@#%_:;=,/-]+$

image-20240725-082038.pngImage Added

RegEx in XML: ^[.

Regex shows the information message

\+*?^$()\[\]\{\}&lt;&gt;&amp;&apos;&quot;`~!@#%_:;=,/-]+$

image-20240725-082124.pngImage Addedimage-20240725-082222.pngImage Added

For FAB version 3.3 and 3.3.1, the Validate button is not yet available but a different user help was in place to ensure correctness of RegEx in XML. This is composed of:

  • Information message displayed when hovering on the Regex field to remind users to escape special characters with “\” to help translate the regular expression to its XML counterpart.

Image Modified
    The
    • A question mark icon is

    also showing the
    • placed at the right side of the Regex field. This also shows a similar information message when hovering on the icon.

    Image Modified
    The Regex should have information messages for the escape character "\" when there is a character "{" and "}".
    • When entering a Regex value

    there is a reminder to use escape character.
    When entering a Regex value with

    FAB has 

    • with special characters "{"or "}" without the escape character "\", upon clicking continue the escape character should be automatically added on the regex.

    Regex with escape character "\" already should not have double escape character upon save.

    Script Function

    If you require more advanced validations than a regular expression can provide, you can supply the name of a validation function contained within a Script node.

    Example
    Code Block
    languagejs
    titleExamplelinenumbers
    true
    function validateMyValue(evt)
    {
      var value = evt.getSource().getValue();
      return value == "Valid Value";
      // returning true indicates validation success
    }

    In the above example, the function name you would enter into the Script Function field would be:  validateMyValue(evt)

    Error Msg

    You can provide your own custom error message to be displayed when validations fail.  If not text is supplied, "Invalid Entry" will be displayed. Please avoid using special characters on this.

    Validate Search Help Value

    Checking this option will ensure that any value entered into the Input field is validated against the values returned in the configured search help.  This ensures that a valid value has been entered even if the Search Help dialog was not used.  

    Value Required

    Checking this option will enforce that a value is provided in this field when the user tabs off the field or attempts to submit the form.

    Required At Approval Level

    This option works together with the Value Required checkbox.  When the Value Required checkbox is checked, the Required At Approval Level value will be used to determine exactly when the value is required.  This is useful in more complex workflows where a value may not be required at the time of creation however the second or third approval level may be required to supply data.