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
Bulent703Bulent703 

Page URL is not correct in communities

Hi,

 

I have a Visualforce page called "TestPage1". In the controller I use Page.TestPage1.getUrl() to get the URL for this page. This works fine in regular Salesforce.com platform. However, when I use this in the new communities, it does not put the community name in the URL. So, instead of the following syntax:

 

https://abccommunities-developer-edition.na15.force.com/customers/apex/TestPage1

 

I get

 

https://abccommunities-developer-edition.na15.force.com/apex/TestPage1

 

Is this a bug in the new communities? Is there a way to get this to work?

 

Thanks!

Vinita_SFDCVinita_SFDC

Hello Bulent,

 

This is not a bug, in new communities this is as per design. If you wish to have such feature in new communities as well then post this idea to idea exchange:

 

https://success.salesforce.com/ideaSearch

Vinita_SFDCVinita_SFDC

Hello,

 

Since each community lives at its own URL, if you manually construct a URL in VF, you need to use the $Site.Prefix global variable to account for this. See this page for documentation:
http://developer.force.com/cookbook/recipe/using-force-com-site-specific-merge-fields

 

Hope this helps!