Enforce regex pattern validation by role
ON('validate-record', function(event) {
if (ISROLE('Standard User', 'Field Crew')) {
var str = $name;
var re = /^[A-Za-z]{5}$/;
var result = re.test(str);
if (result == false) {
INVALID('The value for the Name field must be exactly 5 characters');
}
}
});
Updated about 1 year ago