+ 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!