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
oski93oski93 

Update checkbox fields on Lead and Contact with unauthenticated user?

Hi all,

 

I have a requirement whereby we send a user/customer an e-mail (not sent from Salesforce) a link to a Salesforce sites URL.

 

The URL is unique to the user receiving the e-mail, and on access the controller can determine which object (a contact or lead) is associated with the URL.

 

Ideally I'd like to present the user with a page that will allow them to toggle and save some checkbox fields on the related object.

 

My understanding is that sites users are not able to edit standard object data and we don't want to (can't) force users to authenticate in order to maintain this data.

 

Would anyone have any 'best practice' suggestions on how to accomplish the above with Salesforce?

 

Thanks in advance.

Rahul SharmaRahul Sharma

oski93,

 


oski93 wrote:

 

My understanding is that sites users are not able to edit standard object data and we don't want to (can't) force users to authenticate in order to maintain this data.


Your understanding is correct.

In one of my project there was similar issue where we needed to use campaign management in sites. Where we needed to perform dml on Account, Contact, Lead, Campaign, etc. 


Solution is :

You can avoid using standard controller(Page runs in user mode) for your page and just use controller(as here your page runs in system mode), Then you will be able to perform DML on standard objects too.
Also a problem with private sharing model is you dont have permissions on the record. So define sharing rules on required object and give access to Site User.