You need to sign in to do that
Don't have an account?
SalesForceTeamSix
Issue with URL rewrite when having 2 or more parameters
I'm facing an issue with my site where URL rewrite is not working using URLFOR() for 2 or more parameters. As per an answer on Stack Overflow this is an existing issue.
http://salesforce.stackexchange.com/questions/4728/site-urlrewriter-interface-implementation-problem-with-more-than-2-parameters (http://salesforce.stackexchange.com/questions/4728/site-urlrewriter-interface-implementation-problem-with-more-than-2-parameters)
Has anyone faced a similar issue before and how was it resolved?? Please let me know ASAP as I need this urgently.
http://salesforce.stackexchange.com/questions/4728/site-urlrewriter-interface-implementation-problem-with-more-than-2-parameters (http://salesforce.stackexchange.com/questions/4728/site-urlrewriter-interface-implementation-problem-with-more-than-2-parameters)
Has anyone faced a similar issue before and how was it resolved?? Please let me know ASAP as I need this urgently.
If you need it for a case, the internal salesforce reference number is W-957534.
http://salesforce.stackexchange.com/a/5709/198
Same problem here, I see that the StackExchange question (http://salesforce.stackexchange.com/a/5709/198) is too old, from 2012. So there is no solution from Salesforce. Also, when we catch several parameters in URLFOR, the Site URL Rewriter capture the map of parameters of the pagereference adding 'amp;' to the parameter name except the last one. For example, if I have this:
In generateUrlFor(), the params captured with pagereference.getParameters() are like this:amp;param1=value1, amp;param2=value2, param3=value3
Is this a bug? problem with code type? We don't know...
We manage to solve the problem by the ugly and chunky way. Grouping all the parameters in the URLFOR in only one with some format and read it in generateUrlFor() method. For example: params='param1:value1/param2:value2/param3:value3'. Really ugly and string work in the method.
Also you can Javascript the links, generating the hrefs in 'onClick' event with a remote action and launching the friendly url via window.location.href for example.
Anyway, ugly solutions for a bug.