2

I have visualforce page which opens up using window.open in javascript written behind a custom button. There is a cancel (apex:commandbutton) on VF page which calls a redirect method.

public PageReference redirectToAnother() {
    PageReference pageRef;
    pageRef= new PageReference('/apex/TestPage?param1=ADD+param2=MULTI');
    pageRef.setRedirect(true);
    return pageRef;
 }

This works perfectly in 3 different sandboxes but doesn't work in 4th one.

  • There are no errors being shown in Javascript console in Chrome.
  • Firebug also doesn't show any issues.
  • The debug logs in salesforce show exactly same statements in all sandboxes.
  • In the sandbox whereissue exists, the method is returning the correct url but simply the redirection doesn't happen. It shows a blank screen with the currentpage url and all querystring parameters removed.

Any pointers would be appreciated.

  • 1
    TestPage exists and is visible to the context user in the forth sandbox right ? There are no manual setup steps in 4th sandbox that you may have missed ? – CloudHugger Jan 10 '16 at 21:22
  • I would instantiate the PageReference with Page.TestPage instead. You can retrieve the parameters and add to them with getParameters. It might not give you more information but it is cleaner imo. – Adrian Larson Jan 10 '16 at 22:48
  • @CloudHugger yes page permissions exist. no manual setup steps missed. – SF Ninja Jan 11 '16 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.