Copy link to clipboard
Copied
How can i make this work?
<cflocation url="index.cfm?#Replace(desiredutl, "add", "view")#" addToken="false">
Copy link to clipboard
Copied
In what way does it not work currently?
You're not giving us much to go on here.
--
Adam
Copy link to clipboard
Copied
it just doesn't replace anything
Copy link to clipboard
Copied
Well the syntax is correct.
What's an example of of the input variable for the replace() call?
You are away replace() is case sensitive, yeah?
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f42.html
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-6e0e.html
--
Adam
Copy link to clipboard
Copied
this is a part of url "page.addticket&id=0&pid=2AD5ABC6-1D09-1845-0D24AB258C4F0DC7"
<cfset var desiredurl = arguments.event.getValue("desiredurl")>
<cfif len(desiredurl)>
<cflocation url="index.cfm?#ReplaceNoCase(desiredurl, "addticket", "viewticket")#" addToken="false">
</cfif>
Copy link to clipboard
Copied
Refactor the code so you get rid fot he <cflocation> and the API call, just having something like this:
<cfset desiredurl = "#the actual value of the url, hardcoded#">
<cfset result = ReplaceNoCase(desiredurl, "addticket", "viewticket")>
<cfdump var="#variables#">
I imagine you'll see the result you'd want to see. So the question then becomes... what's different between your production code and your test code. I'd check the values of all the variables at play. I suspect one of them not what you think.
--
Adam