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
1 answer
43 views

Flows with flow bulkification to check if record exists

I am creating a flow which can be invoked in bulk mode with multiple records. I have read the help articles for automatic flow bulkification, and have a good idea what's going on. I have a ...
  • 2,611
0 votes
0 answers
25 views

Updating date value for open records at the start of each month

I have a flow that is designed to update a record at the start of each month if the record remains open. I.e. Billing Month = 1 August, come Sept if that record status is still "Open" then ...
2 votes
1 answer
112 views

Is it possible to use a date range as map's key and then use a date to find the entry?

I have a list of records that map to a particular date range. For eg: 1 Jan 2020 - 31 Dec 2020 -> Toyota, Aston Martin 1 Jan 2021 - 31 Dec 2021 -> Red Bull, Mercedes, Ferrari 1 Jan 2022 - 31 ...
  • 303
0 votes
1 answer
44 views

Flow Invocable Apex- Error when running flow in bulk

I am trying to run a record triggered flow when multiple records are created. What I have now, works perfectly until I try to enter more than one Record at a time. I get the following error: The ...
's user avatar
0 votes
0 answers
166 views

Flow to create multiple tasks for different queue

Use Case When an Opportunity Stage is changed to "Approved" , create multiple Tasks and assign to different Queues - Create Task for 'Customer Management Queue' Create Task for one or ...
2 votes
1 answer
183 views

Hitting governor limits and getting the "Apex CPU time limit exceeded"

I had to write a trigger to manage a lead deduplication process designed by someone else. In a nutshell: A lead gets inserted Checks on name and email of existing leads and contacts (person accounts) ...
  • 307
1 vote
0 answers
42 views

Is it possible to POST multiple Tooling SObjects with a single request? [duplicate]

I've seen and tested that I can create or update single records of TraceFlag (for example) using "/tooling/sobjects/SObjectName/". However, years of working with Salesforce has ingrained in ...
1 vote
1 answer
165 views

Record Triggered Flow trying to create duplicate records

I have a record triggered flow that needs to create related records if they do not already exist. However, once the record is created, if other records in the transaction would have triggered a create ...
1 vote
1 answer
446 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 ...
0 votes
1 answer
125 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 ...
0 votes
1 answer
52 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 ...
0 votes
1 answer
175 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 ...
  • 25
-2 votes
1 answer
83 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 ...
  • 13.9k
0 votes
2 answers
72 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 ", ...
1 vote
1 answer
191 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 ...
  • 95
0 votes
0 answers
47 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 ...
3 votes
0 answers
315 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 ...
1 vote
1 answer
192 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 ...
0 votes
1 answer
88 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&...
2 votes
0 answers
156 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 ...
0 votes
1 answer
143 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 ...
  • 13.9k
0 votes
1 answer
299 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 ...
0 votes
1 answer
60 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 ...
  • 3
0 votes
2 answers
66 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 ...
  • 446
3 votes
1 answer
6k 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 ...
  • 661
0 votes
1 answer
29 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 ...
  • 1,183
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 ...
  • 1,183
0 votes
1 answer
103 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 ...
  • 127
1 vote
0 answers
328 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 ...
  • 11
0 votes
1 answer
79 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 ...
  • 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 ...
9 votes
1 answer
1k 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
416 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 ...
  • 466
4 votes
3 answers
3k 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 ...
  • 43
0 votes
1 answer
48 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 ...
3 votes
1 answer
216 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 ...
  • 140
0 votes
1 answer
592 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, ...
  • 15
0 votes
0 answers
357 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
1 answer
891 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
1 answer
81 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 ...
  • 143
0 votes
1 answer
137 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 ...
  • 45
0 votes
1 answer
262 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 ...
  • 17
0 votes
1 answer
67 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
1 answer
302 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 - ...
  • 485
0 votes
1 answer
34 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 ...
3 votes
2 answers
1k 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
1 answer
205 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
1 answer
351 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
1 answer
332 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
1 answer
140 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 ...

1
2 3 4 5