i want to replace / in the date with . But it only...
# suitescript
v
i want to replace / in the date with . But it only replaces the first / , not the second one. I am using replace function. could anyone please help me?
v
Getting this error TypeError: Cannot find function replaceAll
c
Share your code
e
TypeError: Cannot find function replaceAll
Most likely the data type of whatever it is you're calling
replaceAll
on is not a String
r
x = x.replace(/\//g, '.') Try this ? The Date x needs to be in string format.
d
could also be due to suitescript 2.0 vs 2.1 , I believe
replaceAll
is only available in the latter
v
Thank you its working