PeopleSoft : Phone Number Validation Using Regular Expressions in Peoplecode
PeopleSoft : Phone Number Validation Using Regular Expressions in Peoplecode
Local String &str = "\+{0,1}[0-9\s\-\(\)]+";
Local JavaObject &oPhoneNumExpression = CreateJavaObject("java.lang.String", );
Local JavaObject &oPhoneNum = CreateJavaObject("java.lang.String", Record.Field.Value);
If &oPhoneNum.matches(&oPhoneNumExpression) = False Then
MessageBox(0, "", 0, 0, "Enter valid phone number");
End-If;
Regular Expression "\+{0,1}[0-9\s\-\(\)]+" : It allows a number + in starting and - in the middle of the number.
Record.Field.Value : Contains the entered phone number value.
Keep Learning, Keep sharing.
Thank you for visiting by blog, If you like it please share and check out more content.
Comments
Post a Comment