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
YSPYSP 

Updating a field as a user other than logged in user.

If I have an object in Salesforce that a profile currently does not have any access to however I want to add a button which updates a field on a record in that object is that possible?

Can there be any customization which can allow the update to happen as a user which does have access to the object or even as an admin or is giving access to the object the only option?
Best Answer chosen by YSP
Umesh RathiUmesh Rathi
Hi,

You will not be able to update any field on the object record to which the profile does not have access to.
It can be done if the user does not have access to the record but has access to the Object.
Hence, Object access is necessary. If Object access is there but record access is not give, and still you want to update the record then you can make your ape class as without sharing. I think this should work in that case.

Thanks,
Umesh Rathi

All Answers

Umesh RathiUmesh Rathi
Hi,

You will not be able to update any field on the object record to which the profile does not have access to.
It can be done if the user does not have access to the record but has access to the Object.
Hence, Object access is necessary. If Object access is there but record access is not give, and still you want to update the record then you can make your ape class as without sharing. I think this should work in that case.

Thanks,
Umesh Rathi
This was selected as the best answer
AmarpreetAmarpreet
You can use "without sharing" in apex class. Call the Apex method of without sharing class from VF on click of a button and you can update that record.