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
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:

http://www.salesforce.com/us/developer/docs/fundamentals/Content/adg_composite_app_public_sites.htm

 

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

http://www.salesforce.com/us/developer/docs/fundamentals/Content/adg_composite_app_create_public_jobs_try_it_out.htm

 

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

https://c.ap1.visual.force.com/apex/PublicJobs

 

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?

sfdcfoxsfdcfox

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?