1

I want to create a validation rule where only users with the role “UK: Institutional Team” are able to create cases with the record type called “Benchmark Change”.

My Validation rule is;

AND( 
ISNEW(), 
RecordTypeId = '01250000000UK5B', 
$UserRole.Name = 'UKInstitutionalTeam')

However I can create a case and I am system admin

Case
Record type name : Benchmark Change
Record type iD : '01250000000UK5B'

Role Hierarchy
Label: UK: Institutional Team
Role name: UKInstitutionalTeam

4 Answers 4

1

If you want only users with the “UK: Institutional Team” role to be able to create records with this record type, the last part of your validation rule should state

NOT($UserRole.Name = "UKInstitutionalTeam")

since it should fire when the logged in user does not have this role.

3
  • HI Robin I have just changed this logic, and i can still create the record type and i am system admin :(
    – user11500
    Commented Sep 10, 2014 at 12:48
  • are you using the correct role name with correct spacing and cases ? Commented Sep 10, 2014 at 12:49
  • Yeah, i copied it directly from the user
    – user11500
    Commented Sep 10, 2014 at 12:56
1

Should it be

IF( AND( ISNEW(), RecordTypeId = '01250000000UK5B'), NOT($UserRole.Name = 'UKInstitutionalTeam'), false)

0

Try this, AND(RecordTypeId = '01250000000UK5B', !($UserRole.Name = 'UKInstitutionalTeam'))

1
  • Thank you for your advice, however its still allowing me to create a case when i am system admin
    – user11500
    Commented Sep 10, 2014 at 13:20
0

Please remember that the validation rule kicks in at the moment you save the new case, not immediately after you select the record type. It may be more efficient to set up a profile for these users and remove the record type from that specific profile, assuming that they do not need view/edit access to the cases with that case record type either.

If you do want to use the validation rule, then the following formula should work:

AND(
ISNEW(),
RecordTypeId = '01250000000UK5B',
NOT($UserRole.Name = 'UKInstitutionalTeam'))
1
  • Check to make sure that the RecordTypeId is correct. Copy and paste it from the URL when you are on the specific RecordType view.
    – Aaron
    Commented Sep 12, 2014 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .