You need to sign in to do that
Don't have an account?
Ker Vin.ax1237
SUBSTITUTE in APEX
I'm just starting to try out APEX programming, so this is probably going to make experts laugh....... I have a formula field that strips the Mobile Phone number and only stores numeric data. SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( MobilePhone, ")", "" ), "-", "" ), "+", "" ), " ", "" ), "(", "" ) All well and good, then I thought "Can't I just use an APEX trigger to strip those characters out and just store the numeric data in the same field?" .....well, I failed. The substitute command doesn't compile in APEX. Can someone point in me in the right direction? Or am I barking up the wrong tree here? |
Are you getting any error messages? If so, attach it.
Thanks!
Look into REPLACE.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm
-Andy