You need to sign in to do that
Don't have an account?
Sumit Sachdeva
page reference not redirecting properly and stripping parameters
Hi,
I am trying to create a url in my class
it gets created corectly and i am able to see it in debug log
but when i pass it to the pagereference it does not redirect correctly. and it strips the parameters out of the url
this is in my sandbox (Full). Please help.
it should redirect to
but it redirects to
please let me know why this is happening and steps to resolve it
thank you so much
Sumit
I am trying to create a url in my class
it gets created corectly and i am able to see it in debug log
but when i pass it to the pagereference it does not redirect correctly. and it strips the parameters out of the url
this is in my sandbox (Full). Please help.
it should redirect to
/merge/accmergewizard.jsp?goNext=+Next+&cid=001b000000Fva5qAAB&cid=001b000000RvToJAAV&cid=001g000000RUAhaAAH
but it redirects to
/merge/accmergewizard.jsp?cid=001b000000Fva5qAAB&goNext=+Next+
please let me know why this is happening and steps to resolve it
thank you so much
Sumit
You are passing three parameters in same cid variable that is why it is taking only first parameter. This is causing this issue.
if you want to pass multiple values in that separate them using any delimiter such as ; or , or - and then break on the basis of delimiter in your controller.
Thanks,
Himanshu
I understand your point and agree with that. But this is the standard syntax and modifying the parameter identifier to cid1 or cid2 breaks the URL.
I did not completely get what you said in the second line.
please find below my code and advise what should be changed:
Thanks for all your help.
Pageref cut down identical parameters from the url so only option you have is prepare url string in controller side and use javascript to redirect user on oncomplete event.
It should work.
Thanks,
Himanshu
Try this and let me know if it works or no.
pageRefString = '/merge/accmergewizard.jsp';
system.debug('final pageref: '+pageRefString);
PageReference pageRef = new PageReference(pageRefString);
pageRef.getParameters().put('Name1','Value1');
pageRef.getParameters().put('Name2','Value2');
pageRef.setRedirect(true);
Hope this helps.