May 2019
Intermediate to advanced
546 pages
12h 41m
English
In Chapter 3, Declarative Automation, you learned the difference between a set and a list. In a for loop, the iteration of the code in your for loop will happen for every object (record) in your set or list. Let's see an example to clarify this:
for (variable : list_or_set){ // your code}
The variable will be declared in the loop, and the set or list is declared outside the loop. The code will be executed for each iteration:
Set<Integer> setIntegers = new Set<Integer>{1,2,3,4,5,6,7,8,9,10};for (Integer iInLoop : setIntegers){ System.debug(iInLoop);}
Read it out loud, as follows:
Read now
Unlock full access