0

I am trying to create a validation rule for Oppty object that:

  • Prevents users from going back in Oppty stages unless user has certain types of profile
  • Still allows users to close lost or won deals

Below is what I tried, and while it prevents users from moving back in stages it also does not allow users to close won/lost deals.

AND(
    CASE(
        StageName, 
        "Initial Stage", 1, 
        "Second Stage", 2, 
        "Third Stage", 3, 
        "Closed", 4,
        0
    )
    <
    CASE(
        PRIORVALUE(StageName),
        "Initial Stage", 1, 
        "Second Stage", 2, 
        "Third Stage", 3, 
        "Closed", 4,
        0
    ), 
    /*Profile Type1*/
    $Profile.Id != '000000', 

    /*Profile Type2*/
    $Profile.Id != '000000'
)

Any insight or advice is deeply appreciated. Thank you so much and happy Friday!

2
  • This looks to be most of the way there (though you may want to consider using a custom permission instead of relying on profile ids). Can you please edit your question to add more detail about what your closed-lost/closed-won stage names are?
    – Derek F
    Commented Jun 2, 2023 at 21:02
  • @DerekF Your comment made me realize where I went wrong! Thank you so much for taking the time to help. :) I also haven't considered using a custom permission and will definitely look into it.
    – Sae
    Commented Jun 3, 2023 at 2:35

0

You must log in to answer this question.

Browse other questions tagged .