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
Jake GmerekJake Gmerek 

Conditional Security

I have an object that I would like to have security on based on two conditions the users profile and the value of a picklist field.  There are two diffferent tasks that I am trying to accomplish.  First it to hide a button and second is to make the picklist in question read-only.  So logically it would look like this:

 

if (user_profile == correct_user AND picklist1 == correct_data)

display button or allow edit on field

else hide button or make field read only

 

Is there any way to do this?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Create a pagelayout for the correct_user profile, which have the correct_data picklist field as read only and remove the button which you do not show to correct_user profile users. Now assign this layout to your correct_user profile.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

Create a pagelayout for the correct_user profile, which have the correct_data picklist field as read only and remove the button which you do not show to correct_user profile users. Now assign this layout to your correct_user profile.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
Jake GmerekJake Gmerek

Thanks