function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

PageReference Instantiation changes URL content

Hi All - I am troubleshooting an issue with a visualforce redirect to a Conga Merge URL.  I have a custom save button on my page.  When user clicks the button I call a method in the controller that performs several actions.  At the end of the method I return the pagereference.  

What I'm finding is that after I instantiate the PageReference with a URL the resulting reference is different.

Here is my example:  Again this is just for troubleshooting purposes.  This is not my actual URL, my main question is why the url is getting modified.

PageReference ref = new PageReference('');

If I include a system debug right here for the value of ref it is the following

Notice the difference between what I put into the Reference and what is coming out of it.

Can someone please explain why my URL is getting changed?

Thank you very much.
kevin Carotherskevin Carothers
Your "pre" URL has four instances of ReportId -- the "after" URL has one -- the last instance of that param.   

Thanks Kevin for comment.  Yes, that is what is puzzling to me.  The 'pre' is what I'm trying to assign the pagereference to but the 'after' is what is actually getting assigned to the pagereference.  Do you think this has to do with some URL encoding?  Because if you notice in the 'pre' the ?pv0=T33367 gets converted to %3Fpv0%3DT33367 in the 'after'

thanks again!