+ Start a Discussion
Mikey CeeMikey Cee 

Data shows when page accessed from internally, but not on public site

I have been following the salesforce Recruiting App tutorial, and reached the section on creating a public site:



I have built a simple page to display open jobs as described here:



This is displaying the open jobs correctly when I view it through our "internal" URL:



But when I view this same page through our "external" URL: 

http://servian-developer-edition.ap1.force.com/careers, the page still renders, except that now the list of jobs is empty.


I don't think this is a permissions error, as if so it would surely prompt me to log in. What do I need to do to make the data show on the "external" URL?


It is indeed a permissions issue, because the list is empty. This means that Sharing is not allowing access to the records. Check the profile for the site to make sure that it has at least Read access to the custom object, that all of the fields used in the query have their Field Level Security set to Visible, and most importantly, make sure that the Organization Wide Defaults are set to at least Public Read Only, or that there is a Sharing Rule that grants access to the user you are using. Also note that if there is a Master-Detail relationship to Account from your custom object, you will not be able to control sharing, and the Portal only grants access to the Account that the Portal User is assigned to. Portals also have a default (non-authenticated) user, so if you do not require a login, you need to set up sharing so that the default Portal User has the privilege of viewing those records.

Mikey CeeMikey Cee

OK thanks for that - the Field Level Security was not set correctly. Now I have enabled access for the three fields the page is trying to display, I can see NEW Position records that I create. However, on the public URL, I still don't see records that were created before I enabled it (ie. historically). On the private URL, I still see all records. What can be causing this?