Salesforce does support switch and Case statement in Salesforce. The switch statement is used to test whether an expression matches one of many values and branches respectively.
Are you interested in learning Salesforce from scratch! Have a look at this interesting video on Salesforce provided by Intellipaat:
The syntax for using Switch and case in Salesforce is:
switch on expression { when value1 { // when block 1 // code block 1 when value2 { // when block 2 // code block 2 when value3 { // when block 3 // code block 3 when else { // default block, optional // code block 4 }
Also, the when value can either be a single value, multiple value, or sObject types. For example:
When Value1, Value2 { //code block }
Go for this in-depth job-oriented Salesforce admin certification now!