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
SFDC_DeveloperSFDC_Developer 

How to pass parameters in return url of vf page:

I am sending parameters in rturn url like below:
<apex:commandLink onclick="window.open('/{!list.Id}/e?retURL=apex/Mypage?id={!Event.Id}&{!parameter}')" value="Edit" id="edit"/>


after doing some action on standard page I want to return back to my vf page with some parameters but it is returning just one parameters not others like:
/apex/Mypage?id={!Event.Id}


but I need this url:
/apex/Mypage?id={!Event.Id}&{!parameter}'Here parameter is string

 
pconpcon
If you url encode it first then you can add those parts.  So your url becomes
 
<apex:commandLink onclick="window.open('/{!list.Id}/e?retURL=apex%2FMypage%3Fid%3D{!Event.Id}%26{!parameter}')" value="Edit" id="edit"/>

It might be easier (and safer if {!parameter} may contain non-alpha chars to use EncodingUtils methods inside of the controller and generate an encoded string that is then inserted in the VF page.
Ken KoellnerKen Koellner
I had to do the same thing.  Do what pcon suggests. you have to URL encode the ? and & of the retURL or they get taken by the original window.open URL.