Join Duard Lynn Davis for an in-depth discussion in this video Lists, part of Learning Salesforce.com Development.
- [Instructor] Now let's take a look at lists.…Lists are a grouping of objects.…They are not unique so an object could be in the list twice.…So the first thing we would do is we'd instantiate our list…and it would be list, less than,…whatever the object is that you want to create a list for,…and then your greater than sign.…So in this case, we've got a list of Contact,…and my list of contact one equals a new list of contact.…So that instantiates it, I'm now able to add to that…by just doing the name of my list dot add…and the value that I want to place in there.…
One thing I want to point out is a common error…that is made is you forget to instantiate and create…this new object, my list contacts one.…So when somebody actually goes to try and use it…they will get a null exception error.…Another useful way to use lists is in a query.…So we can say list contact, my list of contacts…equals, and a select statement.…When doing this, there's something…that you want to keep in mind.…If I say list contact, my contacts equals and I do a select…
AuthorDuard Lynn Davis
- How Apex works
- Bulkification and triggers
- Systematically debugging your code
- Sets, lists, and maps
- Trigger and trigger handlers
- Batch Apex
- Debugging and logging
Skill Level Intermediate
1. Introduction to Environment
2. Sets, Lists, and Maps
3. Trigger and Trigger Handlers
4. Batch Apex
5. Debugging and Logging
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.