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
ShamilShamil 

Visualforce page URL is not removed from the address bar

Hello,

I see a strange behavior with a Visualforce in my managed package:
1. There is a button on Opportunity that links to a VF page
2. When button is pressed the URL changes to:
https://myprefix.na6.visual.force.com/apex/mypage?scontrolCaching=1&id=0068000000O7yGb
3. VF page has a 'Save' button that has the following code:
PageReference myPage = new PageReference('/' + opportunityId);
myPage.setRedirect(true);                               
return myPage;

basically all it does is redirects a user to an Opportunity screen with the opportunityId.

BUT, when user is redirected to the Opportunity page the URL remains the same (and never changes no matter where you go):
https://myprefix.na6.visual.force.com/apex/mypage?scontrolCaching=1&id=0068000000O7yGb


Thanks,
Shamil
Best Answer chosen by Admin (Salesforce Developers) 
BrianWKBrianWK

I had this same problem.

 

The solution was to turn off development mode.

 

Development mode creates something like a frame - so even though you "saved" and were re-directed the URL doesn't update. Someone else without the ability or with development turned off would get the expected URL update.

All Answers

BrianWKBrianWK

I had this same problem.

 

The solution was to turn off development mode.

 

Development mode creates something like a frame - so even though you "saved" and were re-directed the URL doesn't update. Someone else without the ability or with development turned off would get the expected URL update.

This was selected as the best answer
ShamilShamil

Thanks a lot, that solved the issue!

...I was  breaking my head on it, wandering what the problem was.

BrianWKBrianWK

Shamil,

 

I know I found it very frustrating myself. It was not something I would have previoulsy considered. I think it might have been a change between Winter 09 and Spring 09. I know when I started using Visualforce back in November I didn't have this issue, and then this Spring I did.

 

Regardless, I've moved from editing my pages directly in Salesforce to moving it to the IDE with Ecclipse. On one hand I've lost the nice ability to view my pages "live," but on the other I no longer get the annoying messages that my controller has been changed simply because I saved my Page in Salesforce while editing the controller in the IDE.

TedLiuTedLiu
Great and Thanks it worked for me.
Apex code.ax1542Apex code.ax1542

Thanks a lot, i found my solution.