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
petec@i2isyspetec@i2isys 

Formula with And, Or, and Not

Hello,
I'm trying to fire a workflow email for when new business opportunity goes from stage 1 to stage 2.
So the forumla should check to make sure the Oppty Type is not Add-On OR Professional Services.  If it's neither of those then it should see if the stage moved from 1 to 2.

I came up with this and it fired no errors, but my tests fail and nothing happens.

AND(NOT(OR( ISPICKVAL(Type, "Add-On"), (ISPICKVAL(Type, "Professional Services")))),( ISPICKVAL(StageName, "2-Align")) ,(PRIORVALUE(StageName)= '1-Prospect'))

Can anyone see where I'm going wrong?
Best Answer chosen by petec@i2isys
Roman RiabenskyiRoman Riabenskyi
Hello! This formula worked for me:
AND(
NOT(
OR( 
ISPICKVAL(Type, "Add-On"), 
ISPICKVAL(Type, "Professional Services"))),
ISPICKVAL(StageName, "2-Align"),
ISPICKVAL(PRIORVALUE(StageName), "1-Prospect"))

 

All Answers

Gururaj BGururaj B
Use below formula:
AND(NOT(OR( ISPICKVAL(Type, 'Add-On'), (ISPICKVAL(Type, 'Professional Services')))),( ISPICKVAL(StageName, '2-Align')) ,(PRIORVALUE(StageName)= '1-Prospect'))

If it works please mark as best answer.
petec@i2isyspetec@i2isys
Hello, I tried with your formula but it still did not fire. Your formula seems to be the same as mine only you changed double quote" to single quote'
But it did not work.
Dinesh MultaniDinesh Multani
Try this
IF(NOT(OR(ISPICKVAL(Type, "Add-On"),(ISPICKVAL(Type, "Professional Services")))),true,IF(AND(ISPICKVAL(StageName, "2-Align"),(PRIORVALUE(StageName)= '1-Prospect')),true,false))
Roman RiabenskyiRoman Riabenskyi
Hello! This formula worked for me:
AND(
NOT(
OR( 
ISPICKVAL(Type, "Add-On"), 
ISPICKVAL(Type, "Professional Services"))),
ISPICKVAL(StageName, "2-Align"),
ISPICKVAL(PRIORVALUE(StageName), "1-Prospect"))

 
This was selected as the best answer
petec@i2isyspetec@i2isys
This worked perfectly, thank you!