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 ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • Custom Script to Trigger an Alert if there is no email address associated with Requester (using FAFR)

                        Working on Builds: 14500 too Scenario: Request should not be created if there is no email address associated with the requester. Instead it should prompt and alert stating there is no email address associated with the requester. The above requirement ...
                      • Script to Populate User Additional Field under Incident Template using FAFR

                        The script load the Requester Name under Incident Additional field ( As a pick list), by choosing the requester name under additional field the script populates the user additional field value. * Kindly create two additional fields under Admin -> ...
                      • How to add a URL link to a Pop Up/Alert in FAFR ?

                        Please use the below script as mentioned. Replace the link with the desired link. alert ("please check below link"); window.open("https://www.manageengine.com/products/service-desk-msp/readme.html");  Refer below link for FAFR config if required, ...
                      • Script to set fields from CSV using FAFR.

                        Works in 10604 Requirement: Load Data from CSV depending on the value selected in an additional field. Usecase: Assume there are 3 additional fields for a request template, namely, "Reference number", "Payment type and "Vendor". "Reference number" is ...
                      • How to use Account based support e-mail address ?

                        How can i raise a request through an Email and how it will be assigned to an Account? In your mail-server, create a user e-mail account to which all e-mails will be fetched. Create an e-mail alias for this e-mail account for each of your customer ...