Validations

In the “Validations” tab you can create Javascript and regex validations for attributes. Learn more

Note
Validations can only be created for string and number attributes. Note: The latter does not include number range attributes.

User interface


This screenshot shows the user interface under version 5.6.1.

 Selection menu: Menu that is used to select an attribute.

 CREATE: Button that is used to create an empty attribute dataset (deactivated in this tab).

 Delete (Delete): Button that is used to delete the called-up attribute.

 Tab bar: Tab list to access the various parts of the attribute configuration.

 Free-text search: Search field for entering a search term by which the related attributes listed in the table are filtered.

 Reset (Restore): Button that is used to reset the free-text search.

 Validations: Table that lists the validations that were created for the call-up attribute.

Favorites: Customized button to which the various actions from the action menu can be allocated so that you do not have to call them up via the action menu whenever you want to use them. The respective actions can be allocated to the button via drag & drop. And they can be removed in the same way. Each allocation of actions only applies to the logged-in user.

DELETE: Button that is used to delete validations.

CREATE REGEX VALIDATION: Button that is used to call up the dialog box where Regex validations can be configured. Click here to learn more.

CREATE JAVASCRIPT VALIDATION: Button that is used to call up the dialog box where JavaScript validations can be configured. Click here to learn more.

Create Javascript validations

Create validations with an existing Javascript rule

In order to create a Javascript validation with an existing Javascript rule, proceed as follows:

  1. First select the respective attribute as described here.
  2. Click on the CREATE JAVASCRIPT VALIDATION button to call up the corresponding dialog box.
  1. Click on the More button in the “Message” field. Then you will be directed to another slider with input fields for the multilingual error messages.
  2. Enter the various error messages in the corresponding input fields.
  3. Click on thebutton to get back to the previous slider.
  4. Possibly enter an integer value in the input field “Order”. If there are multiple validations specified for an attribute, the respective integer values determine the order in which the validations are executed.
  5. Click on the radio button in the line “Use existing rule”. Following this, the corresponding menu is shown below.
  6. Select a Javascript rule from the menu.
  1. Click on thebutton to get to the “Javascript config” slider. Here the identifier and the script of the selected Javascript rule are displayed.
  • In order to finish the process, click on the SAVE button. chevron to the right A success message is shown. The newly created Javascript validation appears in the list of validations. After the next synchronisation it will be active in the iPIM Portal.
  • In order to cancel the process, click on the CANCEL button.

Create validations with a new Javascript rule

In order to create a new Javascript validation with a new Javascript rule, proceed as follows:

  1. First select the respective attribute as described here.
  2. Click on the CREATE JAVASCRIPT VALIDATION button to call up the corresponding dialog box.
  1. Click on the More button in the “Message” field. Then you will be directed to another slider with input fields for the multilingual error messages.
  2. Enter the various error messages in the corresponding input fields.
  3. Click on thebutton to get back to the previous slider.
  4. Possibly enter an integer value in the input field “Order”. If there are multiple validations specified for an attribute, the respective integer values determine the order in which the validations are executed.
  5. Click on the radio button in the line “Create new rule”.
  1. Click on the button to get to the “Javascript config” slider.
  2. Enter an identifier for the new Javascript rule in the input field “Identifier”.
  3. Click on the More button in the field “Description”. Then you will be directed to another slider with input fields for the multilingual descriptions.
  4. Enter the multilingual rule descriptions in the respective input fields.
  5. Click on theto get back to the previous slider.
  6. Enter a Javascript function in the field “Script”.
  • In order to finish the process, click on the SAVE button. chevron to the right A success message is shown. The newly created Javascript validation appears in the list of validations. After the next synchronisation it will be active in the “iPIM-Portal”.
  • In order to cancel the process, click on the CANCEL button.

Create regex validations

In order to create a regex validation for a selected attribute, proceed as follows:

  1. First select the respective attribute as described here.
  2. Click on the CREATE REGEX VALIDATION button to call up the the corresponding dialog box.
  3. Click on the More button in the “Message” field. Then you will be directed to another slider with input fields for the multilingual error messages.
  4. Enter the various error messages in the corresponding input fields.
  5. Click on thebutton to get back to the previous slider.
  1. Possibly enter an integer value in the input field “Order”. If there are multiple validations specified for an attribute, the respective integer values determine the order in which the validations are executed.
  2. Enter a regular expression in the input field “Regular expression”. For example, if you enter “[abc]” as the expression, an entered attribute value is checked whether it contains the digits “a”, “b” or “c”.
  • In order to finish the process, click on the SAVE button. chevron to the right A success message is shown. The newly created regex validation appears in the list of validations. After the next synchronisation it will be active in the iPIM Portal.
  • In order to cancel the process, click on the CANCEL button.
Note
Regex validations cannot be applied to localized string type attributes.

Regular expressions

This section offers an excerpt overview regarding the syntax of regular expressions:

Expression Explanation
[abc] Using square brackets you can define a character class. A validation using the expression [abc] checks if an attribute value contains the characters a, b or c. If it does not, the respective attribute value is invalid.
[a-z] Using hyphens you can define a range of characters. A validation using the expression [a-z] checks if an attribute value contains a character respectively letter between a and z. If it does not, the respective attribute value is invalid.
[a-zA-Z0-9] Expressions can be linked together. A validation with the expression [a-zA-Z0-9] checks if an attribute value contains lower case letters between a and z, upper case letters between A and Z or digits between 0 and 9. If it does not, the respective attribute value is invalid.
(abc) Using paratheses you can define a character group. A validation with the expression (abc) checks if an attribute value contains the character string abc. If it does not, the respective attribute value is invalid.
[^a] A ^ within square brackets is used to negate characters. A validation with the expression [^a] checks an attribute value to ensure that it does not contain the character a. If it does, the respective attribute value is invalid.
(a|b) The pipe (|) stands for an or. A validation with the expression (red|blue) only accepts attribute values that contain either the word respectively character string red or blue. If it does not, the checked attribute value is invalid.
{n} Using a numerical value in curly brackets you can, for example, specify how often the chracters that were specified in the preceding expression have to occur consecutively. A validation with the expression [a-z]{4} checks if an attribute value contains characters between a and z. The attribute value has to contain at least four of these letters.
{min,max} Using comma-separated numerical values in curly brackets you can, for example, specify how often the chracters that were specified in the preceding expression may respectively have to occur. A validation with the expression [a-z]{4,10} checks if an attribute value contains characters between a and z. The attribute value has to contain at least four of these letters but mustn’t contain more than ten of them.
? A ? determines that the preceding expression is optional. It may occur in an attribute value once. But it mustn’t occur more than once. The ? corresponds to {0,1}.
+ A + determines that the preceding expression has to occur at least once. However, it may also occur as often as desired. The ? corresponds to {1,}.
* A * determines that the preceding expression may occur as often as desired. But it doesn’t have to. The ? corresponds to {0,}.

Use cases

Decimal numbers

The following Regex expression can be used to limit decimal numbers in string attributes to two decimal places. But integer numbers are also valid:

^\d*\,?[0-9]{0,2}$

^ Start of the string
\d* A given number of digits
\,? Optional comma
[0-9]{0,2} Digits between 0 and 9 which must resp. can occur not at all, once or twice at max.
$ End of the string

Change the rules of Javascript validations

In order to change the Javascript rule of a Javascript validation, proceed as follows:

  1. First select the respective attribute as described above. Then, all the validations set up for the selected attribute are shown in the table.
  2. In the respective table row, double-click in the table cell of the “Validation” column. Then appears the corresponding dialog box where the “Validation config” slider is active.
    • In order to replace the selected Javascript rule by an already existing Javascript rule, select the desired Javascript rule from the menu and click on thebutton. Then you will be directed to the “Javascript config” slider where the identifier and the script of the newly selected Javascript rule are displayed.
    • In order to replace the selected Javascript rule by a newly created Javascript rule, click on the radio button in the “Create new rule” line and afterwards click on thebutton. Then you will be directed to the “Javascript config” slider. Enter an identifier, the multi-lingual descriptions and the script for the new Javascript rule.
  • In order to save your changes, click on the SAVE button.Arrow to the right A success message is shown.
  • In order to cancel the process, click on the CANCEL button.
Note
The script of an existing Javascript rule can't be changed at this point. In order to change the script, you need the access the corresponding Javascript rule in the iPIM Workflow module.

Edit regex validations

In order to change the regular expression of a regex validation, proceed as follows:

  1. First select the respective attribute as described above. Then, all the validations set up for the selected attribute are shown in the table.
  2. In the respective table row, double-click in the table cell of the “Validation” column. Then appears the corresponding dialog box.
  3. Enter a regular expression in the input field “Regular expression”.
  • In order to save your changes, click on the SAVE button.Arrow to the right A success message is shown.
  • In order to cancel the process, click on the CANCEL button.

Edit error messages and order values

In order to edit an error message or the order value of a validation, proceed as follows:

  1. First select the respective attribute as described above. Then, all the validations set up for the selected attribute are shown in the table.
  2. Possibly click on the button in the respective table cell to unfold the different locales of a validation. In the “Description” column you will then find the error messages for the different locales.
  3. Double-click in the table cell you want to edit.
  4. Make the desired changes and leave the table cell.
  5. Possibly make changes to further table cells.
  • In order to save your changes, click on the SAVE button.Arrow to the right A success message is shown.
  • In order to cancel the process, click on the CANCEL button.

Delete validations

In order to delete a validation, proceed as follows:

  1. First select the respective attribute as described above. Then, all the validations set up for the selected attribute are shown in the table.
  2. Tick the validation you want to delete.
  3. Click on the DELETE button in the footer. Then appears the  CLICK TO CONFIRM button.
  4. Click on the  CLICK TO CONFIRM button to confirm the deleting of the ticked validation. If the process was successful, a corresponding message will appear and the deleted validation vanishes from the list of validations.

FAQ

What is the purpose of the “Validations” tab?

In the “Validations” tab you can create Javascript and regex validations for attributes. These check attribute values for their validity.

Which attribute types can validations be created for?

Validations can only be created for string and number attributes. Note: The latter does not include number range attributes.

What is the purpose of the “Order” input field when creating a validation?

If there are multiple validations specified for an attribute, the respective integer values in the “Order” input field determine the order in which the validations are executed.

Can the script of an existing Javascript rule be changed?

The script of an existing Javascript rule can’t be changed at this point. In order to change the script, you need to access the corresponding Javascript rule in the iPIM Workflow module.

Can regex validations be applied to localized string type attributes?

Regex validations cannot be applied to localized string type attributes.