Notifications

36 views

Description

Validation Script for Email type where UI Type is selected as "Service portal / All" does not work, allowing records to be saved with incorrect email addresses.

Steps to Reproduce

 

  1. Check the validation script is true for Email type for Mobile/Service portal.
  2. Go to 'New Email Account' catalog item in portal.
  3. Enter an invalid email.
  4. Submit.

    Notice no "Invalid Email Address" error message is shown. The record is saved without validating the email address input.

Workaround

This problem has been identified as a future possible product enhancement. You can subscribe to this Known Error article by clicking the Subscribe button at the top right of this form to be notified when more information will become available.

As a workaround, any validation of an email field can be done via onSubmit Catalog Client Script:
 

function onSubmit() {
//Type appropriate comment here, and begin script below
 var newEmail = g_form.getValue('<fieldname>');

 function isValidEmail(email) {
  return !!email.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,5})$)/i);
 }

 if(!isValidEmail(newEmail)) {
  g_form.addErrorMessage('Invalid email.');
  return false;
 } else {
  return true;
 }
}


Related Problem: PRB1302806

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:42:52
Published:2019-04-18