Validate during the application intake process
During the application process, the public user may input Licensed Professional information in the applicable Licensed Professional area of the application intake form. Any license information provided can be validated by EMSE. Implement this EMSE script by binding the validation script with the Page Flow BeforeEvent or AfterEvent. If validation fails, the error message displays on the related page. For information on associating a script to a page in Page Flow, refer to Associate scripts with a page. For an example script, refer to the template provided in the instructions below.
To configure a validation EMSE to run during account registration
-
Navigate to Civic Platform > Admin tools > Event manager > Scripts
-
Write an EMSE script to bind the ValidateLicense function to the page flow BeforeEvent. See the script example below. For more information about page flow events, refer to Associate scripts with a page.
Application-Intake Page Flow ValidateLicense Script Template
var capModel = aa.env.getValue("CapModel");
var LPModel = capModel.getLicenseProfessionalModel();
// validate the license (Invoke WS to validate the license)
var licenseNbr = LPModel.getLicenseNbr();
var licenseType = LPModel.getLicenseType();
var isValid = ValidateLicense(licenseNbr, licenseType);
// return the result of the validation.
if (!isValid)
{
var returnCode = "-1";
var returnMessage = "The license you have selected or inputted is expired or otherwise not available. Select or input another license.";
aa.env.setValue("ReturnCode", returnCode);
aa.env.setValue("ReturnMessage", returnMessage);
}