I am working on a Picklist requirement which needs to give Edit access to all by default. Once any value is entered by any user, edit access is restricted to all except Admin Profiles.
Any possibility to implement this?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Seems like a validation rule would do the trick.
1. I'm assuming the following: -the picklist would be empty until it is entered by the user, in which case it should now not be editable to all except Admin profiles.
AND( NOT(ISNEW()), ISCHANGED(Your_Picklist_Field__c), NOT(ISBLANK(TEXT(PRIORVALUE(Your_Picklist_Field__c)))), $User.ProfileId <> 'put your admin profile ID here' )
This should prevent anyone from changing the value of the picklist field if the prior value was already not null UNLESS they are the admin profile.
2. Now, if you're saying that the record can be created with a picklist value AND then changed one time that just needs some extras. You could still use a validation rule but you'd probably want a WF rule to stamp a custom field to denote the "first time edit" and then add that field to your validation rule (check if it's blank) to know when to prevent it or let it happen.