+ Start a Discussion
michaelforcemichaelforce 

URLFOR in managed package - namespace issue

I have a managed package, in that managed package is a visualforce page, in that page is a link that is defined using URLFOR($Action.Account.View,d.account.Id).  It works well... UNLESS the customer who has installed this package creates a Visualforce Page of their own that overrides the Account View button.  When this happens, the URLFOR spits out the URL of their customer page but with the namespace of my package... which obviously leads to "Page No Longer Exists".  This seems like a bug... URLFOR should be smart enough to know the page is outside my package and hence should not have the namespace.

Anyhow, my workaround will be to check for visualforce pages in the URLFOR and if it finds one outside the package, then it will simply send them to /{!account.Id}... this will attempt to send them to the standard view page and let Salesforce do any redirect as needed.

My questions for you all:
1) Is this the best way to workaround this?
2) Do we think this is a bug that should be reported or is it by design?
ShashankShashank (Salesforce Developers) 
This has been posted as a known issue and is scheduled to be fixed in the Spring '15 release: https://success.salesforce.com/issues_view?id=a1p300000008XGmAAM