Timeline for Trigger bulkification when adding errors
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 26, 2016 at 23:30 | comment | added | Adrian Larson♦ | @sfdcfox Do want. Just started reading it. :) | |
Feb 26, 2016 at 23:29 | comment | added | sfdcfox♦ |
@AdrianLarson I love the folk over at Blue Wolf, and it was the Selector package that initially got me in to writing my own. Here's the "select" pattern in one version of my internal library: Account[] records = (Account[])Data.filterRecords(Trigger.new, new Data.FieldEqualsFilter(Account.Some_Flag__c, true)); If you're interested, I might post a polished version on my blog shortly.
|
|
Feb 26, 2016 at 23:25 | comment | added | Adrian Larson♦ | @sfdcfox Interesting observation! Curious what you would trim down. I would definitely love to see improvements and I'm sure if anyone still owns the project, they'd welcome them as well. It's a package put together by really smart people I was lucky to work with and learn from. Inspired me to improve my own work. | |
Feb 26, 2016 at 23:12 | comment | added | sfdcfox♦ | +1 for legibility; I like the concept of the Selector framework myself, except that it's far bulkier than it should be. | |
Feb 26, 2016 at 22:08 | comment | added | Adrian Larson♦ | Or if it's true. Either way the behavior will not be affected by your pattern, so that should not be a concern in your selection criteria. @javanoob | |
Feb 26, 2016 at 22:01 | comment | added | javanoob | so If the allOrNone flag is set false, the two patterns behave same?? | |
Feb 26, 2016 at 21:53 | comment | added | Adrian Larson♦ | @javanoob That depends 100% on the calling context, which defines allOrNone behavior. | |
Feb 26, 2016 at 21:52 | history | edited | Adrian Larson♦ | CC BY-SA 3.0 |
added 1187 characters in body
|
Feb 26, 2016 at 21:50 | comment | added | javanoob | No. My question is more on the should I collect all the accounts which are invalid and add error for those accounts in a separate loop or can I just add error for the invalid accounts in the first loop itself. My fear is that if we are importing 200 accounts using dataloader and out of which first account doesn't satisfy the criteria does the trigger process remaining 199 accounts if I use the first approach?? | |
Feb 26, 2016 at 21:45 | history | answered | Adrian Larson♦ | CC BY-SA 3.0 |