Skip to main content
I am trying to write a validation rule that only allows certain users to change an opportunity to Closed/won. Below is what I wrote, but Im getting an error that says Error: Incorrect number of parameters for function 'ISCHANGED()'. Expected 1, received 2

 

What am I doing wrong?

 

AND(ISCHANGED((StageName),"Closed/Won - 100%"),

 

NOT(OR(

 

$User.Id = "00534000009IAAD",

 

$User.Id = "00580000003wipf",

 

$User.Id = "005800000074nof",

 

$User.Id = "00534000009a4KN")))
4 answers
  1. Feb 14, 2017, 8:23 PM
    Leah,

     

    I agree with Mayank that the User IDs should not be hardcoded. At the same time also ensure that you use a CASE function to handle such scenarios wherein you have multiple values to be evaluated against a single field like this as it optimizes the formula and improves the readability !

     

     

    AND(

    ISCHANGED(StageName),

    TEXT(StageName) = "Closed/Won - 100%",

    CASE($User.Id,

    "00534000009IAAD",1,

    "00580000003wipf",1,

    "005800000074nof",1,

    "00534000009a4KN",1,

    0) = 0

    )

     

    If you choose to go with the Alias instead of the ID, then the formula becomes this

     

     

    AND(

    ISCHANGED(StageName),

    TEXT(StageName) = "Closed/Won - 100%",

    CASE($User.Alias,

    "alias1",1,

    "alias2",1,

    "alias3",1,

    "alias4",1,

    0) = 0

    )

     

    That will do the trick !
0/9000