Questions tagged [bulkification]

The practice of structuring code to handle processing multiple records in one transaction. It should scale from processing a single record to hundreds (or more).

Filter by
Sorted by
Tagged with
48
votes
3answers
12k views

General trigger bulkification - best practices

A general question asked from time to time on stack exchange is question of trigger bulkification. Therefore I have 2 questions: Which best practices are you using? What is the best way to handle ...
2
votes
3answers
4k views

Is Process builder a complete alternate for the triggers

I need to do some analysis on process builder for taking a decision on config vs coding. Saying that process builder is the alternate for the Triggers for updating the child records. After ...
1
vote
1answer
624 views

I have a Parent->Child->GrandChild .. I need one object constructed and returned for a rest call

I need to construct one object that will return Forms->Section->Question The objects are Master-Child relationships in the above order. Please let me know how I can construct this object. Appreciate ...
6
votes
2answers
860 views

Single Email Message bulkification is not working in Apex

Description: When I deactivate multiple users, say a,b,c, the following code is triggered to send emails to their respective managers. but in my case the manager receives the email with only the ...
4
votes
4answers
21k views

Trying to create a trigger to prevent creation of duplicate accounts

This is the trigger i have wrote to prevent the creation of duplicate accounts, i am getting an error message saying "Intial term of field expression must be a concrete SObject:LIST ". Can someone ...
5
votes
1answer
2k views

How do processes consume SOQL queries?

I'm currently using processes to update records. The ills describing of using the process builder are known to me, but I need more information on how 'Update Record actions' in a process are bulkified....
9
votes
1answer
2k views

Submit records for approval in bulk without hitting DML Statement limit

I've got code to create and submit for approval a custom object. I'm running into the DML statement limit. As far as I can see each record I submit for approval takes up a DML statement, but there's ...
3
votes
2answers
1k views

How to publish/consume bulkified Platform Events

Use case: External system wants to publish Platform Events to Salesforce. Salesforce wants to consume the Platform Events in a bulkified manner The Platform Events doc offers this REST call: /...
4
votes
1answer
271 views

Why is this ContentNote trigger receiving 1 record at a time even though multiple records are being inserted?

I am seeing a ContentNote trigger called on individual rows even though a bulk insert is done. A stripped down version follows. The debug log output demonstrates that 3 ContentNote objects are ...
1
vote
2answers
84 views

Too Many SOQL Queries: 101 - trigger

I am getting error message and I believe it to be error with this trigger. I am new to coding and this was done previously so any assistance is greatly appreciated trigger setAttendeeNumbers on ...
1
vote
2answers
4k views

Trigger to update Child Records based on Parent Record

I am trying to update the status field of all the related child (Recipe Sheet Items) for a given parent (Recipe Sheet) when the status is updated to 'Void' and I am trying to make this trigger handle ...
1
vote
1answer
62 views

Is my Trigger properly “Bulkified”?

I have a trigger on the Contact object that populates lookup fields from a Custom object (Territory_Reference__c). I'm finding that since this trigger has been put into place, Apex CPU Timeout errors ...
1
vote
2answers
218 views

Apex Trigger Update Case With Account Id Bulk

I have created an apex trigger that will update the accountId on the case. I don't think this will work for bulk inserts and was wondering if someone could glance at this and suggest an edit or to. ...