how to apply validation
Summary:
When we create contact for customer or Prospect Phone no field can accept
anything including numbers ,characters ,Special characters.
required format would be this but it will take special character at field level.
(999) 999-9999
Content (please ensure you mask any confidential information):
Version (include the version you are using, if applicable):
25C
Code Snippet (add any code snippets that support your topic, if applicable):
def phoneNumber = getAttribute("AllPhoneSearch")
// Regex for (999) 999-9999 format
def pattern = /^\(\d{3}\) \d{3}-\d{4}$/
if (!(phoneNumber ==~ pattern)) {
throw new oracle.jbo.ValidationException("Phone number must be in the format (****) ****-xxxx.")
println("Phone# is " + phoneNumber)
}
else{
Tagged:
0