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
ForceRookieForceRookie 

How to restrict a User to view the record programmatically

Can somebody help me on how to create a event or class or with JavaScript remoting..
If I login as ABC User then I go to CustomObject then click the record, if CustomObject has Assigned To__c=ABC User (current user) then there will be an error message (showToast if possible), “Sorry, you don’t have access to this CustomObject record.”

It’s like preventing the current user from viewing the specific record.

Please help.
Sujeet PatelSujeet Patel
You can do this with the help of Permission set as well as Profile what ever you like you can chooose these techniques.
IF YOu like to create Permission set then assign it to user then particular user can access those object another user can't access that object.
I hope this will help full for you.
ForceRookieForceRookie
Hi Patel, the user is a System Admin. I’m not allowed to change anything on permission set, I have to do it programmatically, that if I click the record there will be a pop-up message.