Create a List FOR Loop
Follow Along with Trail Together
Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series.
(This clip starts at the 17:24 minute mark, in case you want to rewind and watch the beginning of the step again.)
Adjust the Loop
Add a List FOR loop to iterate through the bankAccts list that you created.
- In the Developer Console, open the Execute Anonymous window.
- Replace the existing code with this code:
- Verify that Open Log is selected and then click Execute. The execution log opens.
- Select Debug Only.
- Review the debug messages and then close the log.
In the createContact method, add a List FOR loop to iterate over a Candidate list.
- In the CreateContactFromCan class, replace the existing code with this code:
- Save the CreateContactFromCan class.