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
1 vote
1 answer
34 views

The number of results does not match the number of interviews that were executed in a single bulk execution request

I'm getting this error when I insert more than one record into an custom object that has a record-triggered Flow. Flow calls an invocable method to do parse multipicklist values. here's my invocable ...
user avatar
0 votes
1 answer
24 views

Prevent bulk flow execution from creating duplicates

I have an Article__c custom object. That article can appear on several Publication__c objects, Publications having a Language__c field. When the Publication__c record is set active, I need to create ...
user avatar
0 votes
1 answer
48 views

Send value from picklist to APEX

I am pretty new to Apex and VF (started about 10 hours ago), have close to never coded before, and I have this problem I need to solve: The ultimate goal is to be able to select multiple Account ...
user avatar
0 votes
1 answer
43 views

Flow using @InvocableMethod fails when inserting multiple records

I have an Apex class that matches Lead records to existing Contact records based on a phone number input. I'm using @InvocableMethod to include it in a Flow. The Flow works as designed when I insert a ...
user avatar
  • 5
-2 votes
1 answer
42 views

If we installed the package for all users, but we want the tabs access be removed from every profile, how can we achieve that?

My clients ask me. If we installed the package for all users, but we want the tabs access be removed from every profile, how can we achieve that? Is there any faster way rather than going manually ...
user avatar
  • 13.2k
0 votes
2 answers
65 views

Need help moving SOQL out of the loop

Hello, I need move this query out of loop: List<Lead> dupeLeads = [SELECT Id, Email FROM Lead WHERE Id != :Ld.Id AND Email =: Ld.Email]; I'm testing various guides on "bulkifying ", ...
user avatar
1 vote
1 answer
88 views

Avoid bulkification in flow

I update/create (upsert via sf-dataloader) each day the data of our contracts. These contracts (customobject EZR) contain the lastname, surname, birthdate etc... I create an ID with this data (sample ...
user avatar
  • 83
0 votes
0 answers
41 views

Visualforce Page (render as Excel) SOQL Limit Exceeds

Here we want to generate Excel for Every record created/Edited of an sObject. Here we are using VF Page to generate an Excel and then store it in Documents/Attach File Object. So the Flow looks like ...
user avatar
3 votes
0 answers
176 views

Scheduled Flow Not Running for All Records

I am hoping someone can help me with Schedule-Triggered Flows (STF). I have created a STF that gets all leads matching a specific criteria. The flow then checks the record type of the lead. If (Record ...
user avatar
1 vote
1 answer
97 views

Autlolaunched Flow bulkification prevents correct update

I have built a autolaunched flow that is triggered by a process builder related to a custom object. The custom Object is a child object to Account. The use case I am trying to solve is that on the ...
user avatar
0 votes
1 answer
72 views

Bulkify Aggregation Trigger

Is there a way to combine the two aggregates below. public class AccountClass { public static void UpdatePartnerRollup(List<ID> AccID){ // Get Opp Account Map<Id, Account&...
user avatar
1 vote
0 answers
88 views

Salesforce Bulk API Failing Journey Builder Process Builder

For Context: The Salesforce Org is connected to SFMC via MC Connect. We are writing Bulk API to perform ETL on Opportunity/Lead/Account Objects in Salesforce. In Marketing Cloud there are journeys ...
user avatar
0 votes
1 answer
40 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 ...
user avatar
  • 13.2k
0 votes
1 answer
157 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 ...
user avatar
0 votes
1 answer
59 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 ...
user avatar
  • 3
0 votes
2 answers
55 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 ...
user avatar
  • 366
3 votes
1 answer
4k 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 ...
user avatar
  • 619
0 votes
1 answer
24 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 ...
user avatar
  • 1,193
0 votes
1 answer
33 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 ...
user avatar
  • 1,193
0 votes
1 answer
56 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 ...
user avatar
  • 125
1 vote
0 answers
224 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 ...
user avatar
  • 11
0 votes
1 answer
70 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 ...
user avatar
  • 19
0 votes
0 answers
33 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 ...
user avatar
9 votes
1 answer
822 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
1 answer
327 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 ...
user avatar
  • 466
4 votes
3 answers
2k 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 ...
user avatar
  • 43
0 votes
1 answer
45 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 ...
user avatar
3 votes
1 answer
173 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 ...
user avatar
  • 130
0 votes
1 answer
476 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, ...
user avatar
  • 15
0 votes
0 answers
306 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 ...
user avatar
2 votes
1 answer
797 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 ...
user avatar
0 votes
1 answer
40 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 ...
user avatar
  • 143
0 votes
1 answer
131 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 ...
user avatar
  • 45
0 votes
1 answer
153 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 ...
user avatar
  • 17
0 votes
1 answer
65 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 ...
user avatar
0 votes
1 answer
111 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 - ...
user avatar
  • 485
0 votes
1 answer
32 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 ...
user avatar
3 votes
2 answers
962 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/...
user avatar
1 vote
1 answer
124 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 ...
user avatar
0 votes
1 answer
249 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 ...
user avatar
0 votes
1 answer
144 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 ...
user avatar
0 votes
1 answer
124 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 ...
user avatar
0 votes
1 answer
217 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 ...
user avatar
  • 5
0 votes
1 answer
50 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....
user avatar
2 votes
1 answer
226 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 ...
user avatar
2 votes
1 answer
62 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 ...
user avatar
  • 89
7 votes
2 answers
662 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 ...
user avatar
0 votes
2 answers
402 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. ...
user avatar
  • 322
0 votes
1 answer
41 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 ...
user avatar
  • 1
1 vote
1 answer
65 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 ...
user avatar
  • 11

1
2 3 4 5