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
0
votes
1answer
16 views

How Bulk Creation of Custom Objects can be implemented?

How Bulk Creation of Custom Objects can be implemented? Assuming we need to replicate and debug a case where there are 3000 custom objects in the customer org. To replicate this situation, we could ...
0
votes
1answer
23 views

Time-based workflow causing Flow with Email Alerts to fail

I have a time-based workflow that checks a checkbox on an Account which causes a flow to run and send a set of emails to maybe 1-6 contacts via Workflow Email Alerts. The end of the flow un-checks ...
-1
votes
0answers
19 views

Requesting Assistance on nested for loops with Maps [duplicate]

public static Map<Opportunity,Map<Auto_c,Integer>> OQMap = new Map<Opportunity,Map<Auto_c,Integer>>(); for(Opportunity oppty : OQMap.keySet()){ QlisMap....
0
votes
1answer
57 views

Please help with Bulkify code [closed]

I need some help to bulkify following code. It works for 1 record when a user would change the field but I am worried that it would hit Governor limits as soon as bulk data load would occur. I am not ...
0
votes
0answers
40 views

Bulkify Apex Code

I have an Apex code allowing me to send alerts to the Head of Service of a Business Unit. Let's say a Case is created for the Business Unit APAC, then the Head Of Service APAC(aka John Smith) receives ...
0
votes
2answers
33 views

How to bulkify a trigger with many dependent SOQL queries

In our org when we clone a case we would like to bring with it only the most 20 recent email messages and attachments. This is to avoid encountering heap size limits. The below is the code that ...
1
vote
1answer
632 views

Do record triggered flows run on multiple records?

I'm trying to implement some logic that I would normally use Apex for, but decided to try record triggered flow so that it would be easier for an admin to turn on or off. When I create a record ...
0
votes
1answer
22 views

Trouble Bulkifying Trigger Utility Class

I have a utility class for a trigger on a custom object (Territory) that is meant to query all the Territory records for an Account when a Territory record is updated. It then either sets a custom ...
0
votes
1answer
29 views

Bulkified Class?

I have a utility class for a trigger on a custom object that queries the custom object records for an account when one of the custom object records is updated and then sets a custom checkbox field on ...
0
votes
1answer
28 views

Updating Child records in bulk

I am trying to update the children records when the parent field is updated. The code I have works but I was wondering is it the optimized for data loads. So if a user uploads 1000 Lease records and ...
1
vote
0answers
31 views

Please Help Build a List of Flow Limitations

(long post – sorry) Hoping to solicit some feedback about flow limitations to establish some clear thresholds for when to use them versus APEX or custom Lightning Components (Web or Aura). I and a few ...
0
votes
1answer
44 views

Trigger not working on Bulk records properly

**Requirement** - Requirement is to generate a random number(not sequential) for every case getting created, provided number remains unique in salesforce database. The number is then appended with ...
0
votes
0answers
32 views

Narrowing a selection based on values in a Map<String,String>

Each day, I want to... Upsert new/changed time logs via Apex. Generate a Map where key = Jira_Issue_c, value = Activity__c Find previously created records matching Jira_Issue_c but not Activity__c ...
8
votes
1answer
353 views

How do I bulkify queries for directly or indirectly related records?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
1
vote
1answer
52 views

Apex Bulkification — Too many SOQL queries: 101

I have an APEX Class that I have bulkified but is still giving me trouble with Batches of 200 Records. I was hoping to get assistance in making the APEX more efficient, any assistance/direction would ...
2
votes
2answers
378 views

Bulkification of Flow with invocable action - error re: number of results - how do I resolve?

I'm getting the error "The number of results does not match the number of interviews that were executed in a single bulk execution request" when I insert more than one record into an object ...
0
votes
1answer
42 views

Help understand Apex class / bulkilfy

I posted another question here: Help troubleshoot Flow hitting governor limit looks like the apex class we are using may need bulkify, can anyone point me in the right direction as to how to extend ...
2
votes
1answer
66 views

Handling batching in new Summer '20 Platform-Event Flows

We are planning to use the new Platform-Event Flows once Summer '20 is released next week, but I have a question around batching. Currently we use apex triggers to handle platform events. Those can ...
0
votes
0answers
27 views

Using the Bulk API, can I create both Custom Objects and their parent Person Accounts concurrently? [duplicate]

Our org uses Person Accounts. Each Person Account will be a parent record for at least on Bank_Detail__c record. We have an externally hosted website which will collect information about our pending ...
0
votes
1answer
217 views

Mass upsert Master Detail records at the same time

I have two custom objects with Master Detail relationship. I need to be able to bulk upsert these records simultaneously. For example: If the master records don't exist, create them. Otherwise, ...
0
votes
0answers
129 views

Do customer community/customer community plus licenses have access to Data Loader/Data Import Wizard?

I want to know if customer community or customer community + user licenses have access to data transfer applications like Data loader or Data Import Wizard? If not, is APEX driving custom component ...
2
votes
1answer
418 views

How to bulkify a flow launched FROM Apex Trigger?

I am launching a flow from APEX and I want to pass it a list of IDs. The issue that I am coming across right now is that I will need to look up each ID in the flow because there is no "IN" clause for ...
0
votes
1answer
18 views

Fill lookup via foreign key after insert

Problem: I have an external service bulk inserting a task and including a foreign key to my table business. The service will be creating ~100-500 tasks at a time. I'm trying to build a bulkified ...
0
votes
1answer
94 views

A Batch class for trigger? Or there is another solution?

I have a trigger for many records. In my unit test there is no problems with 1500 records. But I'm getting the 'Apex CPU time limit exceeded' error with 1800 and more records. Is Batch the only ...
0
votes
1answer
55 views

How to bulkify trigger when I have to query using a field in Trigger.new?

I am writing a trigger for a custom object (Subscription__c), where I need to find other records of the same object that share a lookup to Contact (field name: Subscriber__c), and copy some ...
0
votes
1answer
60 views

Bulkify a Trigger

I have written a trigger on Tenant_Details__c object which has a lookup relationship to Room_Details__c object. Every time a new record is inserted, I want to update a field in Room_Details__c and ...
0
votes
1answer
37 views

Update Parent Record with value from Latest Child Record

I have a trigger that updates a parent record with value from latest child record entered but I'm having trouble bulkifying it. Here's what I've got: //Parent Object - ObjectA //Child Object - ...
0
votes
1answer
29 views

Bulkifying a class

I'm trying to process and update a bunch of claims within an occurrence. Please guide and assist me on how to bulkify the below code. My debugs are currently returning empty. Please assist so I can ...
2
votes
2answers
495 views

Scheduled Flow Bulkification

There is not much documentation yet surrounding the release of Scheduled Flows (Winter 20). This article (https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/...
1
vote
1answer
53 views

Can we pass a list of id in UserId on a soql query made on UserRecordAccess

I am trying to find access levels on a certain record and this falls in a body of a trigger for which i need to bulkify the data coming in. So is there a possibility of passing a list of ids in the ...
0
votes
1answer
73 views

Mapping two Lists/Sets

I am trying to get my head around mapping two sets (or if this is even the right approach). The objective is to take the name of a custom object (which is currently an email address) and map it to a ...
0
votes
1answer
26 views

Trigger on Account to create case when account customfield is of type Multiselect picklist is updated

I'm having plan__c field on account object.whenever its is updated I want the new values of plan__c is the subject of a case and new case to be created if new values and old values match no case is ...
0
votes
1answer
87 views

How to BULKIFY my code? [duplicate]

I am having a really hard time bulkifying my code, and need to do so becasue I am reaching the SOQL limit on execution. Here is my code as of now. public class Zenefits_Time_Off implements ...
0
votes
1answer
128 views

Mastering Maps: Help needed for bulkifying a simple Opp Trigger Handler

As a beginner I'm currently learning how to bulkify my Apex Classes. I wrote an Apex Class with the following logic: When an Opportunity's stage is changed to Closed Won ... 1. Create an Asset for ...
0
votes
1answer
37 views

How to bulkify a method that queries all the AccountContactRelation relating the Account and Contact Listed in the Opportunity

I need help creating a method that queries the AccountContactRelation object and throws an error when an Opp is created without having an AccountContactRelation between its Primary Contact and Account....
2
votes
1answer
110 views

Insert of ContentVersion not bulkifying properly

I'm currently testing a trigger on ContentDocumentLinks. In order to check in a test class if it bulkifies correctly, I first try to create many contentVersions (so they can the be added to ...
2
votes
1answer
47 views

how to bulkify the next apex code

I got the code below that I had to bulkify it. Basically we need to query campaign share record from a campaign when the cxampaign_approver(lookup to users) field is updated and then remove the manual ...
5
votes
1answer
314 views

How to bulkify Flow call from Apex

I have a process built with a Process Builder. It fires on contact update/create. Under certain conditions that process launches a Flow. Flow accepts two Parameters - ContactId and AccountId. If I ...
0
votes
2answers
277 views

Migration Flow Too Many SOQL Queries

I created a one-time use flow for migration purposes. It looks up all the records to update, and calls a subflow to update each one. The subflow runs 8 or 10 queries and then updates one record. ...
0
votes
1answer
35 views

Use Schema in Trigger

In attempting to "Bulkify" my trigger, it was suggested that I use Schema for getting RecordTypeId. As I'm not really a developer (I'm just taking a stab at updating the code that was created by a ...
1
vote
1answer
63 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 ...
-3
votes
1answer
59 views

Trigger ---I want to delete the contacts in bulkify , but it fails to delete contacts over 600 , error: cpu time timit exceeds [closed]

public class AccountContactHandler2 { //trigger AccountContacttrigger2 //---------------After insert ----------------- public static void createContact(List<Account> acc ){ ...
-2
votes
1answer
76 views

how to aviod soql query in the loop , i have to get get child data in my method

I have 2 object object1 and object 2(related object) ,,,i wrote trigger on object1 when object 1 record gets created user record should get created.. i stored profile perssion set information in ...
0
votes
0answers
39 views

Processing & writing bulkified validation using more than 50k records

I have two fields in my Opportunity object: Phone_1__c & Phone_2__c. Now I have to check to check the whole Org, if there are any opportunities made earlier using any of these two numbers. (Org ...
0
votes
1answer
4k views

“Too Many SOQL Queries” in flow where I need to work with 5000 records

I have a few thousands Contacts and a few thousands Accounts. I need to update a custom field of all my Accounts with Emails of related Contacts. In my flow I get "Error Occurred: Too many SOQL ...
0
votes
1answer
46 views

Help Bulkifying this Opportunity Trigger

I have written the following Opportunity trigger that is working but I know it's definitely not bulkified. It's definitely got some duplication and when any user has any more than 40/50 ...
1
vote
1answer
490 views

Checkmarx Code Quality Warning

After running a Checkmarx scan it returned a code quality warning on a method due to Query: Bulkify Apex Methods Using Collections In Methods. The method is very simple: @AuraEnabled public ...
0
votes
2answers
59 views

I'm having hard time bulkifying a code that attach similar deals to an opportunity when is created

the parameters are: amount within 10% of difference closed won last year Same industry I'm having hard time since is I have to validate 3 parameters instead one. Below you have the non-bulkified ...
2
votes
1answer
311 views

Bulkify Apex Approval.ProcessSubmitRequest

I have an apex class that submits opportunities for approval if they are over a certain threshold. This works great when processing small batches, but when trying to submit larger batches it fails ...
0
votes
1answer
32 views

Help bulkifying a simple trigger

I'm trying to create a trigger that sets a case status to "closed" if there are more than 2 cases created that day associated with the same contact. This is so far what I have written, but I'm ...

1
2 3 4 5