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
Kirsty BeyersKirsty Beyers 

Validation rule for locking a Task

Hi all

Is there a validation rule I could develop which will lock a task record except for certain roles? 

So an error condition formula which stipulates which specific roles have editing access?

Thanks
ssssssssssssss
This should work:

AND( NOT (ISNEW() ) , OR( $User.UserRoleId = 'xxxxxxxxxxxxxxx', $User.UserRoleId = 'xxxxxxxxxxxxxxx' ))


Please mark as solved if this helps you.


~S
Kirsty BeyersKirsty Beyers
Thanks!

I tried the following, but it's not quite working.

AND
NOT(
     (ISNEW(), 
   ),
 OR(
   ($User.UserRoleId = '00ED0000000odvg'),

   ($User.UserRoleId = '00E20000000jzRV')
   )

Any suggestions?
ssssssssssssss
You are missing a bracket after AND. I tried the following and can confirm it works. 


Please try again and let me know.

Thanks.

~S
AND( NOT (ISNEW() ) , $User.UserRoleId = '00EC00000012mQ3')

 
Kirsty BeyersKirsty Beyers
Thank you.
ssssssssssssss
Please mark as solved so that others can benefit :)