
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 02:39 AM
I have defined a Variable Validation Regex for a simple 6 digit number on my Madrid system:
This expression works fine and generates the field error:
However, when I hit the submit button the record is submitted without an error.
Other posts on this forum suggest that the submission should be prevented with an error
Is there anything else I need to do?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:34 AM
Hi there,
Yes it should prevent the submission. Tested this on Madrid + New York.
Are you using default SC Catalog Item widget? Catalog Item? Record Producer? Are you on Madrid or other version?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 02:54 AM
Hi,
I assume you use Client script and your are not stopping the form submission.
Use return false.
Thanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:26 AM
Hi GaryJHayes,
Better go for client Script:
Type : On change
Field : <Select_variable> //Employee Number
Script :
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var empid= /^[0-9]{6}$/;
if (!empid.test(newValue) && newValue!="") {
g_form.setValue('<variable_name>',''); //Employee Number
g_form.showFieldMsg("<Variable_name>","Not a Valid Employee number","error");
}
)
Regards,
Sanket

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:38 AM
Below Article may help you!!
I found an Article which says that it will Prevent the form Submission.
Regards,
Sanket