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
justynjustyn 

Data not visible online

Hi

 

I've got a working search page in visualforce using apex controllers. It works fine in Salesforce user environmen, but I now want to make it visible on our website for others to us. 

 

I've got the page displayed in Sites and can see the page and interact ok with teh search filter boxes. My only issue is that the data is not displaying! I have amended the Public Profile so that the Apex code is enabled and the relevant Custom object is enabled for read only access. The data does not display however. It is linked to the Contacts object which has read access enabled as well.

 

Would it help to see the controller code?

 

I hope someone can help.

 

REgards

 

Justyn

Best Answer chosen by Admin (Salesforce Developers) 
TheSwamiTheSwami
Try removing "with sharing"
If that works, then you would need to look at your sharing rules.

All Answers

TheSwamiTheSwami

What about the field level security?  If you can post a simple repro (under 25 lines), that would help.

justynjustyn

Hi

 

The field levle security is:

 

FieldsField Access2011

ReferralsRead-Only

Added to WebEditable

Counselling Practice NameRead-Only

Counselling ServiceEditable

Created ByRead-Only

Currently ActiveEditable

DonationsEditable

Fee AmountEditable

Format of sessionsEditable

For WhomEditable

Free ServiceEditable

Full FeesEditable

GenderRead-Only

Healthboard ClientsEditable

Interests & SkillsRead-Only

Languages usedEditable

Last Modified ByRead-Only

Legacy CodeHidden

MemberRequired

Member Prof. MembershipsRead-Only

Member QualificationsRead-Only

Membership CategoryRead-Only

Membership StatusRead-Only

NegotiableEditable

Practice Area/TownEditable

Practice City/CountyEditable

Practice EmailEditable

Practice PhoneEditable

Practice StreetEditable

Practice WebsiteEditable

Received New Referral FormEditable

Referral CountyEditable

StatusRead-Only

Therapeutic ApproachEditable

TitleRead-Only

TheSwamiTheSwami

Are you using "with sharing" on your controller?  That could also restrict the results.

justynjustyn

Hi

 

The controller starts with:

 

public with sharing class ReferralSearchController {

 

I can paste the full controller if it helps.

 

Justyn

TheSwamiTheSwami
Try removing "with sharing"
If that works, then you would need to look at your sharing rules.
This was selected as the best answer
justynjustyn

Hi

 

That seems to have solved the problem.

 

Thanks.

 

Justyn

TheSwamiTheSwami

Just make sure that you do not inadvertantly expose  records that should be private.  Removing "with sharing" keywords makes all records visible.

justynjustyn

Hi

 

Thanks for the heads up. I have a few filters on the soql which restricts the records that are displayed.

 

Justyn