You need to sign in to do that
Don't have an account?

Replacing non-numeric values in phone fields
Hello,
I want to implement a functionality
Where on a button click Phone number field will eliminate non-numeric values
There are phone numbers like 030 / 3906 345-61 ,07272 / 7704 1245 O etc,I want to eliminate all non-numeric values in these numbers.
Any sample code snippet on this.
Thanks,
Tejas
I want to implement a functionality
Where on a button click Phone number field will eliminate non-numeric values
There are phone numbers like 030 / 3906 345-61 ,07272 / 7704 1245 O etc,I want to eliminate all non-numeric values in these numbers.
Any sample code snippet on this.
Thanks,
Tejas
References:
String.replaceAll - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_replaceAll
java.util.regex.Pattern - http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
Create a detail page button and select Onclick javascript as the source of the button and add the below code.
I have taken contact for my example. Please modify as per your requirement.
The above code will replace all characters except numbers.
Mark this as "SOLVED" if your question is answered.
Regards,
Bhanu Mahesh Gadi