- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎03-27-2019 08:06 AM
In Madrid there is a new functionality that will greatly reduce time and effort that we are spending on adding validations to the variables on the catalog form. The new feature is Variable Validation Regex.
In several cases we will be doing the same validations for some variables in different catalog items using client scripts ,it will obviously take some time to implement the validations to each variables even though it is already existing.
In long term it will cause maintainability issues because the number of scripts will grow with time while adding additional functionalities to form.
Using this new feature we can avoid the above cases. Now let see how to use this feature :
Create Variable Validation Regex:
- Navigate to Service Catalog > Catalog Variables > Variable Validation Regex > Click New.
- Give a name for the record.
- In Regular Expression enter the sequence of characters that define the format of the variable value.
- In Validation message - enter the message that needs to be appears when the validation fails.
- Submit the form.
Using the created Variable Validation Regex in catalog form:
1.Navigate to Service Catalog > open the item in which you need to add this validation > open the variable dictionary.
2.Configure form layout to add the Validation Regex field.
3. Select the Validation Regex created previously and save.
Testing it in catalog form:
Test your variable in the form, If you enter an invalid input it will throw the error-out the variable and shows error message, and also prevents form submission without reentering the correct input for that variable.
We can use a single variable validation regex in any number of variables having similar validations. It helps to reduce code,effort and saves time.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Updates:
Known issues:
1.
"If there's a mandatory variable validated by a regex, it's still possible to submit the catalog item, however, it'll get stuck on submit. If the variable isn't mandatory, it'll be validated correctly and the item can't be submitted"
Fix: no fix available (PRB1355430)
Workarround:
Workarround for above issue(by Mark Gaghavan)
2. Unable to submit form without clearing the error message( Madrid)
Right now, if you input an invalid entry and then clear the variable, the error remains and you are forced to enter a valid entry to clear the error even if the field is not mandatory. You cannot submit unless the validation error is cleared.
Fix: Issue fixed in NewYork
If this article helped you , please bookmark it or mark it as helpful.
-Satheesh