FAFR script to validate email address

FAFR script to validate email address

Script

var field = "WorkOrder_Fields_UDF_CHAR1";
var emailID = $CS.getValue(field);
if (!ValidateEmail(emailID)) {
    alert('Please enter a valid email address example@abc.com');
    $CS.stopFormSubmission();
}
/*A function which takes email and validate it*/
function ValidateEmail(mail) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)) {
        return true;
    }
    return false;
}

Replace the highlighted field with the additional field name. You can obtain the name from Reports Tab >> New Query Reports >> Run the below query

select columnname,aliasname from columnaliases


                  New to ADSelfService Plus?