2

I would like to create a Validation Rule that allows only System admins to access certain Record types (but still access all available record types). This is a temporary fix until we can update our profiles accordingly.

I am getting

Error: Syntax error. Missing ')' for the below formula.

What am I missing?

IF ( 
$Profile.Id = "000d00000000000", 
AND (
$RecordType.Id = 
"000d00000000000", 
"000d00000000000", 
"000d00000000000",
"000d00000000000", 
"000d00000000000", 
"000d00000000000"
ISNEW() 
))
1
  • When you say "access," do you mean view, or edit? Mar 30 '18 at 18:55
1

You need to compare to a variable every single time. Also, no need for an IF, either.

AND (
$Profile.Id = "000d00000000000", 
OR(
$RecordType.Id = "000d00000000000", 
$RecordType.Id = "000d00000000000", 
$RecordType.Id = "000d00000000000",
$RecordType.Id = "000d00000000000", 
$RecordType.Id = "000d00000000000", 
$RecordType.Id = "000d00000000000"),
ISNEW() 
)

As an aside, I strongly suggest you avoid using ID values when possible, and stick to names instead. Using ID values are not necessarily portable across orgs.

3
  • Hi @sfdcfox. I tested this with a non System admin and I was able to create a record with one of the record types listed in the formula.
    – beauvs01
    Mar 30 '18 at 15:54
  • @beauvs01 You might have meant <> instead of =. The validation rule triggers when the formula evaluates to true.
    – sfdcfox
    Mar 30 '18 at 17:47
  • Thanks, @sfdcfox. I used <> instead of = and that worked.
    – beauvs01
    Apr 2 '18 at 12:09
0

This is configured in the profile settings for the Object

2
  • 1
    While this is correct, the question states "This is a temporary fix until we can update our profiles accordingly."
    – David Reed
    Mar 30 '18 at 21:50
  • @DavidReed I'm not sure how Validation Rule could help here
    – o-lexi
    Mar 30 '18 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.