Liveserver inline functions question

21 views
Skip to first unread message

Dmitry

unread,
Nov 4, 2009, 3:57:57 PM11/4/09
to RedDot CMS Users
I'm trying to use the replace inline function and find the
documentation woefully inadequate:

I think to replace a . (dot) with bothing it should work like this:

<rde-dm:rdb mode="update" alias="owDeltaCRM"
sql="Insert Into Results (FirstName,)Values('[#request:fname#].replace
(java.lang.String '.', java.lang.String '') ');"/>

it does not. Anyone get this to work?


Jonathan W

unread,
Nov 5, 2009, 5:54:36 AM11/5/09
to RedDot CMS Users
I would try:

[#........#].replace(.,)

the first parameter is a . and the second parameter is completely
empty and they are separated by a comma.

Quote marks seem to be unnecessary so that's the way I regularly use
it. It may also work with single or double quotes if you prefer it,
but I've never used them:

[#........#].replace('.','')
[#........#].replace(".","")


The java.lang.String prefix is just a Java convention for showing the
type of parameter expected and should not be reproduced when you
invoke the function.

Jonathan

Dmitry

unread,
Nov 5, 2009, 11:37:38 AM11/5/09
to RedDot CMS Users
Thank you Jonathan, I feel like a doofus for not trying that. It works
great. One more question though can the replace inline function
replace multiple items in one string or would i have to chain them
like this:

[#........#].replace(".","").replace("*","")

Again, thanks for your help.

Jonathan W

unread,
Nov 5, 2009, 12:18:32 PM11/5/09
to RedDot CMS Users
The code you've supplied here is what I would use.

J

Dmitry

unread,
Nov 5, 2009, 3:57:22 PM11/5/09
to RedDot CMS Users
One more thing to ask if I may be so bold.

How do I replace single and double quotes?

[#........#].replace(""","")


[#........#].replace(",)

and

[#........#].replace('"','')

all seem to break the page...

kimdezen

unread,
Nov 8, 2009, 7:01:17 PM11/8/09
to RedDot CMS Users
I would also like to know how to replace quotes..

I contact supported about this problem and they werent able to give me
a work around either.

Cheers,
Kim

Dmitry

unread,
Nov 13, 2009, 12:15:20 PM11/13/09
to RedDot CMS Users
bump
> > all seem to break the page...- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages