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
sumeet kumar 12sumeet kumar 12 

Read access to Contact records from Salesforce Site

Hi,

I have created a basic Salesforce site which allows users to enter data and it saves in a custom object.Along with this site-user also has to select a contact record to associate the data with contact. So I have created a lookup field to Contact object in my custom object. 

I have created a public group which contains guest user and from sharing rule i have granted read only permission to this group. Profile also has permission on contact and OWD for contact is private.

But when I click on lookfield in site it asks me authorization requested. Is it access issue? Can anyone please help me urgently on this.

Thanks,
Sumeet
Ajinkya1225Ajinkya1225

Sumeet,

Did you turn on the extenal sharing model? Go to sharing settings and turn on the external sharing. Also, if it doesn't work out- you may have to use without sharing class to expose the respected fields in a visualforce page on your site. This should resolve your problem.

Please upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh
sumeet kumar 12sumeet kumar 12
Thanks Ajinkya. I tried with external sharing model but it did not work.The previous developer has implemented similar thing by exposing contact read permission to site user and I have done in same way. Probably I am missing some setting or access for it.

I am trying to use with sharing class now.

Thanks,
Sumeet

 
Ajinkya1225Ajinkya1225
Sumeet,

Can you post the URL of the site of the available solution? It is difficult to assess the problem. Another thing- its WITHOUT SHARING!

There was a similar type of functionality we implemented. We were exposing accounts as picklist on a site using without sharing. 

Can you take a moment to  upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh