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
johncusackjrjohncusackjr 

ApexPages.currentPage().getUrl(); returns WRONG Url?

Hi,

I am developing an application using Flex and Salesforce. In my custom component controller I am using

 

 

ApexPages.currentPage().getUrl();

 

 to retrieve current page url. After completing flex stuff, I am returning to the current page using this return url.

 

This is working in my Developer organization which has a namespace prefix.

 

But when my customer installs this managed package and uses this custom component inside their custom visualforce page it is appending my namespace prefix to it, instead that custom page and my customer environment does not have a namespace prefix.

 

So when user clicks OK button it is trying to return to https://c.na7.visual.force.com/apex/MYDEVELOPMENTNAMESPACE__MyCustomPage....

but the page stays at  https://c.na7.visual.force.com/apex/MyCustomPage....

 

How can I solve this problem? Is there a dynamic way to solve this problem or do i need to get the url as string then split and remove namespace?

 

Thanks in advance,

John

 

PS.: If this is a bug and there is no solution, I'm planning to use history.go(-1); in my javascript call. Does that cause a problem?
Message Edited by johncusackjr on 12-07-2009 04:52 AM