Skip to main content
wording + wrong field name
Source Link
neff
  • 1.4k
  • 14
  • 20

You can do that with a combination of two validation rules: working on current fields

Vallidation Rule 1

Prevent making any changes when Level equals Archived or Closed. PRIORVALUE seems to be not working here so I used ISCHANGED function unless User is a Sys Admin. Needed to exclude situation when changes are done to Level because otherwise it will not allow to enter Archived or Closed. PRIORVALUE seems to not work here so I used ISCHANGED function to capture that.

AND(
   $Profile.Name <> 'System Administrator',
   NOT(ISCHANGED(Level__c)),
   OR(
      ISPICKVAL(Level__c, 'Archived'),
      ISPICKVAL(Level__c, 'Closed')
   )
)

The thing is that this rules allows making changes if User at the same time changes Level__c. That's why we need second Validation rule.

Vallidation Rule 2

Prevents User from changing Level__c once it is Archived or Closed, unless he is a Sys Admin

AND(
   $Profile.Name <> 'System Administrator',
   ISCHANGED(StatusLevel__c),
   OR(
      ISPICKVAL(PRIORVALUE(Level__c), 'Archived'),
      ISPICKVAL(PRIORVALUE(Level__c), 'Closed')
   )
)

You can do that with combination of two validation rules:

Vallidation Rule 1

Prevent making any changes when Level equals Archived or Closed. PRIORVALUE seems to be not working here so I used ISCHANGED function. Needed to exclude changes to Level because otherwise it will not allow to enter Archived or Closed

AND(
   $Profile.Name <> 'System Administrator',
   NOT(ISCHANGED(Level__c)),
   OR(
      ISPICKVAL(Level__c, 'Archived'),
      ISPICKVAL(Level__c, 'Closed')
   )
)

The thing is that this rules allows making changes if User at the same time changes Level__c. That's why we need second Validation rule.

Vallidation Rule 2

Prevents User from changing Level__c unless he is a Sys Admin

AND(
   $Profile.Name <> 'System Administrator',
   ISCHANGED(Status),
   OR(
      ISPICKVAL(PRIORVALUE(Level__c), 'Archived'),
      ISPICKVAL(PRIORVALUE(Level__c), 'Closed')
   )
)

You can do that with a combination of two validation rules working on current fields

Vallidation Rule 1

Prevent making any changes when Level equals Archived or Closed unless User is a Sys Admin. Needed to exclude situation when changes are done to Level because otherwise it will not allow to enter Archived or Closed. PRIORVALUE seems to not work here so I used ISCHANGED function to capture that.

AND(
   $Profile.Name <> 'System Administrator',
   NOT(ISCHANGED(Level__c)),
   OR(
      ISPICKVAL(Level__c, 'Archived'),
      ISPICKVAL(Level__c, 'Closed')
   )
)

The thing is that this rules allows making changes if User at the same time changes Level__c. That's why we need second Validation rule.

Vallidation Rule 2

Prevents User from changing Level__c once it is Archived or Closed, unless he is a Sys Admin

AND(
   $Profile.Name <> 'System Administrator',
   ISCHANGED(Level__c),
   OR(
      ISPICKVAL(PRIORVALUE(Level__c), 'Archived'),
      ISPICKVAL(PRIORVALUE(Level__c), 'Closed')
   )
)
Source Link
neff
  • 1.4k
  • 14
  • 20

You can do that with combination of two validation rules:

Vallidation Rule 1

Prevent making any changes when Level equals Archived or Closed. PRIORVALUE seems to be not working here so I used ISCHANGED function. Needed to exclude changes to Level because otherwise it will not allow to enter Archived or Closed

AND(
   $Profile.Name <> 'System Administrator',
   NOT(ISCHANGED(Level__c)),
   OR(
      ISPICKVAL(Level__c, 'Archived'),
      ISPICKVAL(Level__c, 'Closed')
   )
)

The thing is that this rules allows making changes if User at the same time changes Level__c. That's why we need second Validation rule.

Vallidation Rule 2

Prevents User from changing Level__c unless he is a Sys Admin

AND(
   $Profile.Name <> 'System Administrator',
   ISCHANGED(Status),
   OR(
      ISPICKVAL(PRIORVALUE(Level__c), 'Archived'),
      ISPICKVAL(PRIORVALUE(Level__c), 'Closed')
   )
)