Post

3 followers Follow
0
Avatar

Read Only Validation Rule

Need help writing a validation rule. We need to have everyone's create/edit ability paused unless you are a few specific users. How do you write a validation rule so that users cannot add/edit?

Andrea Melde Answered

Please sign in to leave a comment.

5 comments

0
Avatar

Hello Andrea,

You can prevent users from creating/editing by creating validation rules. For example, you can prevent all users except "this.is.a.username" user from editing work items, by following these steps:

1) Go to Settings >> Configure >> select Work Item on the left hand side >> Create New >> Validation rule;

2) Set runtime to "Every time a record is created or edited";

3) Set evaluation criteria to CurrentUser() <> "this.is.a.username";

4) Set any error message you'd like users to see when they attempt to edit work items.

I hope this helps.

Best regards,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

How can we make this rule work against multiple usernames?

Jamie Berger 0 votes
Comment actions Permalink
0
Avatar

Hello Jamie,

What do you mean by saying "against multiple usernames"? Do you want the rule to trigger or not to trigger for these users?

Please provide a specific example.

Thank you,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

In the example above you list:

3) Set evaluation criteria to CurrentUser() <> "this.is.a.username";

I'm asking how we continue this for more than one username. I created this rule for a specific username to make it so they could not edit anything, now I'm asking how to add another username to this rule so they cannot as well.

 

 

 

Jamie Berger 0 votes
Comment actions Permalink
0
Avatar

Hello Jamie,

If you want the rule to trigger (to prevent action) for two users, you should use this: CurrentUser() = "this.is.a.username1" || CurrentUser() = "this.is.a.username2"

If you want the rule to not trigger (to allow action) for two users, you should use this: CurrentUser() <> "this.is.a.username1" && CurrentUser() <> "this.is.a.username2"

I hope this answers your question.

Roland

Roland Pumputis 0 votes
Comment actions Permalink