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
theoptheop 

Rule on StageName

I have a workflow that kicks of when the stage changes to 'Closed Won' The issue is that the workflow doesn't get kicked of if a brand new opportunity gets created and immediated set to 'Closed Won' I'm trying to check to see if the StageName is ISBLANK, ISNULL, etc. But can't get the right combination. When the stage gets changed on when it was set to something works. Evaluation Criteria is set to 'Evaluate the rule when a record is created, and every time it’s edited' Here is what I've tried. Thanks for any help.

 

OR(
AND( NOT(ISPICKVAL(PRIORVALUE(StageName ), "Closed Won")), ISPICKVAL( StageName , "Closed Won") ), 
AND( ISNULL(PRIORVALUE(StageName)), ISPICKVAL( StageName , "Closed Won") ) 
)

 

OR(
AND( NOT(ISPICKVAL(PRIORVALUE(StageName ), "Closed Won")), ISPICKVAL( StageName , "Closed Won") ), 
AND( ISBLANK(PRIORVALUE(StageName)), ISPICKVAL( StageName , "Closed Won") ) 
)

 

OR( 
AND( NOT(ISPICKVAL(PRIORVALUE(StageName ), "Closed Won")), ISPICKVAL( StageName , "Closed Won") ), 
AND( ISPICKVAL(PRIORVALUE(StageName ), ""), ISPICKVAL( StageName , "Closed Won") ) 
)

 

Best Answer chosen by Admin (Salesforce Developers) 
theoptheop

For anyone interested, ISNEW() is what I was looking for.

 

OR( 
AND( NOT(ISPICKVAL(PRIORVALUE(StageName ), "Closed Won")), ISPICKVAL( StageName , "Closed Won") ), 
AND( ISNEW(), ISPICKVAL( StageName , "Closed Won") ) 
)