You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

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{

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!