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
darrelndarreln 

workflow rule logic - test for multiple record types

Hello all,
I currently have the following logic in a workflow rule to determine when to send out an email alert:

AND ( 
RecordTypeId <> "012C0000000CCTo", 
ISCHANGED ( Requested_Dev_Date__c ), 

OR 
(ISPICKVAL (StageName , "6.5 Process with Signature" ), 
(ISPICKVAL (StageName , "6.3 Process without Signature" )) 
)))

I now have a need to test for more than one record type ID, while the rest of the logic would stay the same. How do I best accomplish this code? Is the right approach a CASE statement, or IF? How would this be structured?
 
Best Answer chosen by darreln
Shawn Reichner 29Shawn Reichner 29
Maybe try somethign like this...

AND(
ISCHANGED(Requested_Dev_Date__c),
OR(
RecordTypeId = "INSERT RECORD TYPE ID HERE",
RecordTypeId = "INSERT NEXT RECORD TYPE ID HERE",
RecordTypeId = "INSERT NEXT RECORD TYPE ID HERE"),
OR(
ISPICKVAL (StageName. "6.5 Process with Signature"),
ISPICKVAL (StageName, "6.3 Process without Signature"))
)

This should allow for 3 Record Types, and you can add additional lines for any additional RT's if more than three are needed.  This should help out.  If this works for you, please mark as the best answer. 

Shawn
 

All Answers

Shawn Reichner 29Shawn Reichner 29
Maybe try somethign like this...

AND(
ISCHANGED(Requested_Dev_Date__c),
OR(
RecordTypeId = "INSERT RECORD TYPE ID HERE",
RecordTypeId = "INSERT NEXT RECORD TYPE ID HERE",
RecordTypeId = "INSERT NEXT RECORD TYPE ID HERE"),
OR(
ISPICKVAL (StageName. "6.5 Process with Signature"),
ISPICKVAL (StageName, "6.3 Process without Signature"))
)

This should allow for 3 Record Types, and you can add additional lines for any additional RT's if more than three are needed.  This should help out.  If this works for you, please mark as the best answer. 

Shawn
 
This was selected as the best answer
darrelndarreln
Thank you Shawn, that looks good. I came up with a similar approach:
OR(
RecordTypeId <> "012C0000000CCTo",
RecordTypeId <> "012C0000000kxMt",
RecordTypeId <> "012C0000000kxMs",
RecordTypeId <> "012C0000000kxMq",
RecordTypeId <> "012C0000000kxMr",
AND(ISCHANGED ( Requested_Dev_Date__c )),
 
OR
(ISPICKVAL (StageName , "6.5 Process with Signature" ),
(ISPICKVAL (StageName , "6.3 Process without Signature" ))))

Does the order of ORs and ANDs matter in this context, or is either approach valid?

 
Shawn Reichner 29Shawn Reichner 29
I would always start with your AND fist as you have criteria stating that this and this needs to happen AND this or this AND thos or this.  Hope that makes sense. 

Shawn