function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ker Vin.ax1237Ker 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?
vsfvsf

Are you getting any error messages? If so, attach it.

 

Thanks!