I am trying to figure out how to properly "bulkify" a trigger to handle mass deletes when launching an autolaunched flow. Documentation seems to be sparse on this. Will the flow bulkify itself if I instantiate it for every object in the collection, or do I need to use a set and loop through that before launching a flow (thinking this because the mass delete could include multiple of the same FundID parameter I am passing into the flow)?
Yes - I will move this to a trigger handler once I get some feedback on this.
Code below:
if(trigger.isDelete)
{
if(trigger.isAfter)
{
for (Manager_Contact_Relationship__c mcr : Trigger.Old){
Map<String, Object> params = new Map<String, Object>();
params.put('FundID', mcr.Manager_Fund__c);
Flow.Interview.Update_MCR_Records MCRFlow = new Flow.Interview.Update_MCR_Records(params);
MCRFlow.start();
}
}
}