Skip to main content

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
0 answers
46 views

Graph api and Flow Triggers

I'm really new to SalesForce api and processes. My requirement is to update a custom object in SF 'customObject'. The records are logically grouped with a field 'fieldGroup'. After create/update of a ...
Ilias Pap's user avatar
0 votes
1 answer
36 views

How to create a Map in apex to effectively bring soql outside loop for 2 objects manipulation

I have 2 objects , Account (look up to Acc landing) and Account Landing. Account landing has a field called accountid, which I need to update if the account has a acc landing associated to it. My ...
Elizabeth J's user avatar
0 votes
0 answers
43 views

Bulkification not working for Before Delete Record Triggered Flow

Issue: The flow works for single record delete scenario, but not in the bulk record delete scenario. It is written with assumption that Flows Bulkification is taken care by salesforce in these ...
Kushal Malu's user avatar
2 votes
1 answer
41 views

How does `EventBus.TriggerContextsetResumeCheckpoint()` work?

I'm currently looking at the "Apply Best Practices for Writing Platform Event Triggers" Trailhead where EventBus.TriggerContext.setResumeCheckpoint() is apparently used to set "...
Brian Kessler's user avatar
0 votes
1 answer
82 views

Apex Bulkification Issue

I have an SObject variable in which I'm adding the field api names and the values respectively as it acts as a Map and later adding it to a List<SObject> variable. The below code works as ...
apz's user avatar
  • 452
1 vote
1 answer
186 views

How Salesforce executes a flow on a record triggered plus subflow vs only record triggered

I was wondering if someone here could help me have a bit more clarity over a behavior I'm seeing when executing flows in SF. I need to call a subflow from a record-triggered flow to execute some ...
David de León's user avatar
0 votes
2 answers
50 views

Not sure if code is perfectly written for bulkification inside invocable method

I have been reading a lot of bulkifying code inside of the invocable methods both here at stack exchange and outside. More reading has led to a lot of confusion and still not sure if I have done it ...
sumchans's user avatar
  • 789
1 vote
1 answer
201 views

Flow Bulkification with respect to duplicate Update Records on the same parent record

I'm designing a flow to roll up values to a parent record, and although I've reviewed the documentation here on bulkification, there is a piece that I haven't quite figured out. The flow will run upon ...
boop's user avatar
  • 13
0 votes
1 answer
119 views

Inserting List of ContentVersions and ContentDocumentLinks at the same time

I'm looping through a list of records, creating content versions, adding to a list of content versions and then inserting the list of content versions. I then need to create a content document link to ...
Joe Hayes's user avatar
  • 372
0 votes
2 answers
67 views

If a user can access only the salesforce UI, will there be multiple transaction for that user?

Please correct me if I am wrong. Somewhere I read an article that each account has their own separate transaction. Also, I don't think that customers will be using Developer Console to update or ...
ratRiot01's user avatar
0 votes
1 answer
239 views

Do I need to Bulkify a DML inside a loop followed by end in Flows

I have a flow that only fires once per case record when an email-to-case comes in. It finds the email alias the case came through and assigned some values to the case record. I'm assessing a flow that ...
eHarazi's user avatar
  • 151
0 votes
0 answers
120 views

Trying to understand how to bulk update via a schedule trigger flow

I created a schedule trigger flow to update 1000s of opportunities every night. The job of this flow is to find any inactive opportunity and close-lose it. However, I am hitting "...
Ty Haas's user avatar
-1 votes
1 answer
78 views

Independent Bulkification vs Batched Processing

I have been acquiring quite a bit of information about how bulkification and batch record processing works in salesforce (bits and pieces - salesforce documentation does not seem exhaustive). While I ...
Luke Sharon's user avatar
3 votes
1 answer
497 views

Salesforce Bulkification Across Transactions

Here is a fun question I have been puzzling over. So, I have been learning a lot lately about salesforce bulkification and governor limits, specifically as they relate to bulk upload of data into ...
Luke Sharon's user avatar
0 votes
1 answer
950 views

Help bulkify salesforce invocable method (called from flow)

I have a very basic invocable action that is used by a flow to return the useraccess record if the user has edit rights (if not, the return would be a null list - barring sysadmin users of course). I ...
Ben's user avatar
  • 13
1 vote
0 answers
15 views

Avoid iterating over list inside loop [duplicate]

Hello guys I have two lists. One has contact records and other has ContentVersion records. What I need to do is that by every contact I have to create a documents and attach to them by using the ...
TechGuy's user avatar
  • 117
-2 votes
1 answer
60 views

How to bulkify the code, I am facing Too many SOQL queries

The most common error any developer faces is Too Many SOQL queries while working on Trigger. In this code I am facing Too many DML on line AggregateResult. trigger DrawingSharing on Drawing__c (after ...
apz's user avatar
  • 5
1 vote
2 answers
476 views

Mark custom object record as duplicate via Apex for large (100,000+) data sets

Let's say I have a data load that inserts 100,000 unique records of a custom object - call it MyObject__c. Each record has a lookup to a Contact record that is populated. I want to iterate over the ...
SCVandal's user avatar
  • 113
2 votes
3 answers
376 views

Looking for documentation that explains when SF sends multiple records to a Trigger

I've been writing trigger code for years so that it handles multiple DML events for a long time. I've been trying to find documentation that explained when SF would bundle multiple DML events ...
Michael Sobczak's user avatar
3 votes
2 answers
7k views

Salesforce Scheduled flow bulkification best practice/ clarity

I have a question about bulkifying scheduled flows. When you create one you have two options. Use a get element to grab the records you want or set an object & conditions. I've found the ...
Thomas Gunn's user avatar
0 votes
1 answer
610 views

How can I use map.keySet() and map.values() in one SOQL?

I have a map like this: Map<ID,List<ID>> invs = new Map<ID,List<ID>>();. I am trying to delete like this: delete [SELECT ID FROM Invoice__Share WHERE ParentId IN :invs.keySet() ...
TomaszOleszko's user avatar
-2 votes
1 answer
412 views

How to do bulk updates using a map?

This is a contact trigger handler updating the account. The aim is getting the most common email domain and rolling that up from the contacts to the account. I'm doing this by looping through the ...
NJW's user avatar
  • 3
1 vote
1 answer
1k 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 ...
hamayoun's user avatar
  • 2,777
2 votes
1 answer
1k 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 ...
N_H1922's user avatar
  • 315
0 votes
2 answers
948 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 ...
user avatar
0 votes
0 answers
2k 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 ...
GroundToCloud's user avatar
2 votes
1 answer
703 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) ...
robruf's user avatar
  • 382
1 vote
0 answers
43 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 ...
Brian Kessler's user avatar
1 vote
1 answer
974 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 ...
Peter Andronakos's user avatar
1 vote
1 answer
3k 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 ...
merve-bulut's user avatar
0 votes
1 answer
854 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 ...
Emmanuel BRUNO's user avatar
0 votes
1 answer
78 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 ...
Hans Rogg-Desormeaux's user avatar
0 votes
1 answer
785 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 ...
JaredC's user avatar
  • 113
-1 votes
1 answer
476 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 ...
Patlatus's user avatar
  • 17.3k
0 votes
2 answers
95 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 ", ...
Alberto Jiménez Domínguez's user avatar
1 vote
1 answer
657 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 ...
Rag21's user avatar
  • 105
0 votes
0 answers
123 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 ...
Kartik Gupta's user avatar
3 votes
0 answers
761 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 ...
Kev Cadger's user avatar
1 vote
1 answer
525 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 ...
Robert Méndez's user avatar
0 votes
1 answer
103 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&...
Laura Bejjani's user avatar
2 votes
0 answers
384 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 ...
PrinceTiwari's user avatar
0 votes
1 answer
387 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 ...
Patlatus's user avatar
  • 17.3k
0 votes
1 answer
693 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 ...
Richard Durrant's user avatar
0 votes
1 answer
62 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 ...
sw007's user avatar
  • 3
0 votes
2 answers
116 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 ...
Luke Bray's user avatar
  • 506
3 votes
1 answer
17k 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 ...
hgolov's user avatar
  • 773
0 votes
1 answer
36 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 ...
J. Neilan's user avatar
  • 1,243
0 votes
1 answer
35 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 ...
J. Neilan's user avatar
  • 1,243
0 votes
1 answer
381 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 ...
Phuc's user avatar
  • 125
1 vote
0 answers
769 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 ...
Peter's user avatar
  • 11

1
2 3 4 5