May 2019
Intermediate to advanced
546 pages
12h 41m
English
Aside from the while and the do-while loops, we can also use extended versions of the for loop in Apex. Extended? Yes. A normal for loop (where you want to count from 1 to 10) is possible in every programming language.
In Apex, you can also use a for loop to walk through the records of a list or the results of an SOQL/SOSL query. (Don't panic if you don't know what SOQL or SOSL are. We will cover SOQL and SOSL queries in the next section of this chapter, Working with data in Salesforce).
In Apex, you have three types of for loops:
First of all, let's discuss the traditional for loop. The for loop contains ...
Read now
Unlock full access