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
Adrian-EAdrian-E 

What is the syntax for SWITCH or CASE conditions?

How do I convert these conditions into SWITCH or CASE format:

 

 

 

if (oldCase.Sub_Condition__c == 'Support - 2nd Tier') { updatedCase.Time_With_Tier2__c += timeSinceLastStatus; } else { if (oldCase.Sub_Condition__c == 'Support - 3rd Tier') { updatedCase.Time_With_Tier3__c += timeSinceLastStatus; } else { if (oldCase.Sub_Condition__c == 'Customer - Confirmation of Fix')...

 


 

 

Best Answer chosen by Admin (Salesforce Developers) 
BritishBoyinDCBritishBoyinDC

Last time I checked, switch was a still 'reserved for future use' and not currently available in Apex