Modify Case Statement to Exclude Certain Records - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Kam HauKam Hau 

Modify Case Statement to Exclude Certain Records

Hi All - I have a CASE statement that is working fine below. I now want to modify it to check the "Status" field on the object. If the "Status" = "Not Applicable," I would like the value to display "0" every time. What would be the best way to modify the statement below? Thank you!

CASE( Name,
"Roles & Responsibilities Defined",5,
"Project Plan Agreed Upon and Signed-off",10,
"Data Integration",10,
"SSO Integration",10,
"Basic System Training",5,
"Locations, ICs, and Pilot Designation",10,
"Pilots Using Web for Lockdown Drills",5,
"Full District (75%) Using Web for Lockdown Drills",20,
"Pilots Using Web + App for Lockdown Drills",5,
"Full District (75%) Using Web + App for Lockdown Drills",5,
"Pilots Using Web/App for All Drills",5,
"Full District (75%) Using Web/App for All Drills",5,
"Wrap-Up Meeting",5,
0)
Best Answer chosen by Kam Hau
Eric PraudEric Praud
Hi Kam,

Try this:
IF(ISPICKVAL(Status__c, "Not Applicable"),0,
CASE( Name,
"Roles & Responsibilities Defined",5,
"Project Plan Agreed Upon and Signed-off",10,
"Data Integration",10,
"SSO Integration",10,
"Basic System Training",5,
"Locations, ICs, and Pilot Designation",10,
"Pilots Using Web for Lockdown Drills",5,
"Full District (75%) Using Web for Lockdown Drills",20,
"Pilots Using Web + App for Lockdown Drills",5,
"Full District (75%) Using Web + App for Lockdown Drills",5,
"Pilots Using Web/App for All Drills",5,
"Full District (75%) Using Web/App for All Drills",5,
"Wrap-Up Meeting",5,
0))

 

All Answers

Eric PraudEric Praud
Hi Kam,

Try this:
IF(ISPICKVAL(Status__c, "Not Applicable"),0,
CASE( Name,
"Roles & Responsibilities Defined",5,
"Project Plan Agreed Upon and Signed-off",10,
"Data Integration",10,
"SSO Integration",10,
"Basic System Training",5,
"Locations, ICs, and Pilot Designation",10,
"Pilots Using Web for Lockdown Drills",5,
"Full District (75%) Using Web for Lockdown Drills",20,
"Pilots Using Web + App for Lockdown Drills",5,
"Full District (75%) Using Web + App for Lockdown Drills",5,
"Pilots Using Web/App for All Drills",5,
"Full District (75%) Using Web/App for All Drills",5,
"Wrap-Up Meeting",5,
0))

 
This was selected as the best answer
Kam HauKam Hau
Eric, you are awesome. Much easier than I thought it would be!