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
Sunshine2Sunshine2 

Alert if Case Status updated inappropriately

I'm trying to create an email notification to notify the QA manager when someone outside of the QA queue modifies the status of a case currently in QA.  I can't modify profiles to address this issue because these people may need to modify the case when it is in their own queue.  I tried the following based on the suggested validation rules but keep getting an error.  I currently have only one user ID but would acually have 3 who would be able to move the status w/o it sending the notification.  Can anybody help?  Thanks.
 

AND ( 

   ISCHANGED(  Status ) ,

   OR ( 

         ISPICKVAL( PRIORVALUE ( Status ) , "03- In QA" ),

         ISPICKVAL ( PRIORVALUE (Status ), "08- In QA for Testing on Production" )),

  $User.Id  <> "00530000000zqkw"

)

 

I also tried

AND ( 
   ISCHANGED(  Status ) ,
   OR ( 
         ISPICKVAL( PRIORVALUE ( Status ) , "03- In QA" ),
         ISPICKVAL ( PRIORVALUE (Status ), "08- In QA for Testing on Production" )),
  NOT ( $User.Id = "00530000000zqkw" )

 

S&PCRMCherylS&PCRMCheryl

Hello,

In the first example, try putting the priorvalue outside of the ISPICKVAL, that might help.
 
Same with the second.
 
Try that and let me know how you make out.  I have done some validation like this in the past, I can try and dig some stuff up for you.
 
And with the User ID you have it set to not equals, so just want to remind you that will be the only user who can make that change.
 
Or without using validation, try to make a new page layout for those outside the QA team, and make the status read only.
 
Cheryl
Sunshine2Sunshine2

Cheryl,

Thanks for your reply.  Unfortunately I discovered PriorValue doesn't work for what I am trying to accomplish.  I'm going to have to go at it from a different direction.  Thanks again.

Melissa
TCAdminTCAdmin
Hello Sunshine2,

The PRIORVALUE() function should work but you have to nullify it for new records. If you do not use the ISNEW() function along with it the system will not allow you to use it.

Code:
IF(
  OR(
    ISNEW(),
    $User.Id  = "00530000000zqkw"
  ),
  NULL,
  OR(
    ISPICKVAL( PRIORVALUE ( Status ) , "03- In QA" ),
    ISPICKVAL ( PRIORVALUE (Status ), "08- In QA for Testing on Production" )
  )
)

This should work for what you want it to do. If the record is new or the user has the Id listed it will not error out at all. If those are not true it will error out if the prior value equals the two values that you listed. Please make sure that the text values used in the Status tests are exact matches to the values in the field.
Sunshine2Sunshine2
I tried it but am still getting an error message.  This time it says the function ISNEW cannot be used in this type of formula.  Any ideas?  Again thanks for all of your help!
 
Melissa
TCAdminTCAdmin
Sunshine2,

You need to make sure you are using the Evaluation Criteria of "Every time a record is created or edited". If you utilize the first or second you normally get the priorvalue error.
Sunshine2Sunshine2
Great it worked!  Thanks for all of your help!!!