+ Start a Discussion

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) 

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