Join Duard Lynn Davis for an in-depth discussion in this video Bulkification of triggers, part of Learning Salesforce.com Development.
- [Narrator] Okay, now that we we've looked at…sets, lists and maps, let's actually see how we might use…them in bulkifying our triggers.…Remember, our trigger has to be able to handle…more than one record at a time…and in this scenario, we're going to use a very simple…process where we're going to say:…Look, we got an account; if that account…is saved, we want to take two value fields…that are on that account and copy them to…an associated contact and an associated opportunity,…so as we go through this, we've talked about sets already,…so we create our sets; we then loop through the code…and we find everywhere that the value is not null…and everywhere the opportunity value is not null…and then, we add those values to our list of contact IDs…and opportunity IDs and both the maps.…
Next step is we need to do a query…of the contacts and the opportunities.…I included these two queries here…where I do the list contact or list opportunity;…set it equal to a query just as an example…to show you that's how you could get those values.…
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.