-
Notifications
You must be signed in to change notification settings - Fork 519
IterationRecipes
pozil edited this page Aug 8, 2023
·
12 revisions
Demonstrates how to iterate on lists and sets
Group Collection Recipes
Demonstrates how to iterate on a list of SObject thanks to the Iterable and Iterator interfaces. This example iterates on Accounts to sum the 'number of employees' field values (use the SUM SOQL function for a real-life application).
| Param | Description |
|---|---|
accounts |
a list of accounts that will be iterated on |
| Type | Description |
|---|---|
| Integer | Integer the total number of employees for the accounts |
Demonstrates how to use a REST API client that leverages the Iterator interface. This example iterates on a paginated record list. Records are represented as strings for simplicity. Remote records are retrieved on the fly by IterableApiClient when the Iterator is accessed.
| Type | Description |
|---|---|
| List | List the 'records' retrieved |