The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
23 views

Efficient bulkification of callouts

I have a requirement to update a property at the geolocation of an account record. Decided that triggers or any synchronous apex isn't the way to go forward primarily due to governor limits. I would ...
0
votes
1answer
24 views

AutoFollow using EntitySubscription

I'm trying to write a bulkified logic for a problem on entity subscription. I've a custom object Student which has custom lookup field to User named as Mentor. The use case is when the mentor field is ...
0
votes
0answers
16 views

Update Object with unique values from Child object using Aggregate result

I am trying to update a field on the Quote (Operational_Start_Date__c) from the results of an aggregate result query. The trigger runs on quote, queries QuoteLine for unique values and update the ...
3
votes
1answer
62 views

Help to Bulkify This -

I have the following method called from a trigger, which calls another method which has SOQL in it. I want to remove that query from the method so that I will not face governer limits issues in the ...
1
vote
2answers
38 views

how to write trigger for bulk records

I tried this by using this inserting, updating employee record. My task is if employee test__c is equal to contact__c test__c employee is automatically created as that contact child if no contact with ...
2
votes
1answer
43 views

Bulkify SOQL with multiple date comparisons

I am just starting out with apex and learning about bulkifying queries but I bumped up across a query that I am not sure how to bulkify. What I am trying to do is return a Count of the number of ...
3
votes
1answer
114 views

How to bulkify a trigger that is having a method to call a future method?

I am having a trigger on Case object. The objective of the trigger is to create a Service Notification record in SAP. As the best practices suggest that we need to bulkify the trigger to avoid ...
1
vote
1answer
52 views

How to resolve Bulkify apex methods using collections in methods (Chckmarx issue)? [closed]

I have submitted my code for security review and got a few warnings for the Bulkify Apex Methods Using Collections In Methods. I have read the code best practices and also some stack exchange posts ...
7
votes
2answers
214 views

Is it advisable to avoid bulkification in a trigger on attachment object?

I'm required to change the title of each attachment on an upload to the name of the expense item. I have written a bulkified code trigger ExpenseProof on Attachment (before insert) { ...
0
votes
0answers
12 views

Flows - Possible To Use Loops with Null Collections?

I have a loop and inside the loop there is a decision and two assignments. The assignments should only be executed if the loop variable is null. However, if the collection is null then there is ...
1
vote
1answer
68 views

Comparing Strings / using LIKE in an if statement

I have an interesting issue: I have a custom object record created with a String for a client Name. I then have to compare that String to Account.Name. If match, add it to a wrapper. I use SOQL to ...
0
votes
0answers
34 views

Can this be done with combo Process Builder and Flow?

I know that I can do this with Apex Trigger but trying to minimize Apex and Apex Test. New to PB and Flows so may be missing something obvious. 1. When user creates or edits an opportunity product ...
0
votes
3answers
70 views

Need help !!!Getting DML limit error in apex trigger

I have a batch class which runs to delete old records, which in turn triggers a trigger on before delete. Now when the trigger runs it hits dml limit as calling class dml statements is running inside ...
0
votes
1answer
42 views

How to bulkify this code

The below code working and doing what is suppose to do but I know that the below code is not optimized/bulkify, how can I bulkfiy this code public void SchedulingClass(List<Reading__c> reading) ...
2
votes
1answer
34 views

Will the upcoming 'bulkifying' improvements to the process builder solve this issue?

I have a headless flow that runs when a new user is created*. It looks up the users email address via a record lookup/contact search. If no contacts exist with that email address a new contact is ...
5
votes
1answer
203 views

Can I Bulky this further?

Is there any way to bulkify this more? Here is the code trigger CreateCampaignMemberBulkify on Contact (after insert,after update) { // Creating a container List<CampaignMember> allCM ...
0
votes
1answer
29 views

Apex trigger: Bulkification code problem

Is there a way to bulkify the below code? If we do a mass update of certain parts, its giving us too many queries. for(Part__c p:Trigger.new){ List<Sampling__c> sampList = [SELECT Part__c ...
0
votes
2answers
27 views

Can I reduce the number of containers and (seemingly) redundant loops when querying parents and grandparents?

tl;dr - I'm retrieving fields on an object, the object's parent, and the parent's parent in a trigger - is there any way to make my code use less than 5 containers and remain bulkified? I have an ...
0
votes
0answers
47 views

Need to Bulkify Trigger Not Supporting Mass update

I have the below Trigger which updates a Guest(Object) Email ID when the Contact(Object) Email ID is updated. The Error now is Im getting an Apex Time Limit Exceeded Error,As the Number of Guests is ...
2
votes
1answer
72 views

Why this strange behavior in the Salesforce debug logs? The query executed twice: 1 returng results and another one returng nothing

I am writing a trigger to update the child of a parent in case a specific field on the parent has changed. The problem is I get a query with 0 results. After looking on the debug logs, the SOQL ...
6
votes
2answers
88 views

Attaching new file causes the page to refresh

Even when I use the reRender attribute, the page is refreshing. How can I prevent that? Page: <apex:page controller="bulkattach"> <apex:form id="form1"> <apex:pageBlock > ...
1
vote
2answers
100 views

“Bulkify” trigger updating parent object

My trigger currently looks like below: trigger UpdatePEPending on Price_Authorization_Extension__c (before delete) { //This trigger is to change the PE Pending field on the Price Authorization to ...
2
votes
1answer
187 views

Apex CPU Time Limit Exceeded on Opp trigger

I have a trigger written on Opportunity and I think it's fairly efficient but when I tried to bulk test it, I received the CPU time limit exceeded error. I know I can get around this by putting it in ...
-1
votes
1answer
113 views

Getting exception'System.LimitException: awduplicate2:Too many SOQL queries: 101'.' while updating records through data loader

I was trying to upload 1000 records through data loader. On updates a trigger will be fired to update few fields on lead . trigger TotalReachout on Task (after update) { List<String> ...
0
votes
3answers
825 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
30 views

Bulkify trigger that checks if a recordtype exists on an account

I am trying bulkify the trigger below. The ERAPayer field is a text field for entering an acccountnumber. What the trigger is doing is on insert of a new payerconfig record, when ERAPayer field is ...
0
votes
1answer
37 views

Better way to bulkify trigger

The trigger below works but I would like to know what I can do to avoid the query in the for loop. trigger eOneAutoCreateProductResponse on Product_Configuration__c (after insert) { ...
12
votes
1answer
470 views

How to best use the “Test Data Builder” pattern in a database context?

I need to setup test data in proprietary cloud platform (Salesforce.com) where I have no access to advanced testing frameworks. Besides that you can read my code example like it would be Java. ...
-2
votes
1answer
63 views

Bulkify Trigger

Updated Any better way without looping circuits__c records and checking all conditions again after getting Building__c map trigger UpdateLoc on Circuits__c (before insert, before Update) { ...
2
votes
3answers
37 views

Help bulkifying trigger

So I am a total newb here and I am sure I'm missing something easy but can anyone tell me why the key isn't being set thus resulting in a null point exception? trigger Contact_Assignment_ET on ...
3
votes
1answer
148 views

4 level, nested for-loop. Bulkified?

I have the following code that works for me. My main concern is the nested for-loops I have toward the end of the code. I'm in the sandbox and don't have enough records to bulk test. I figured I'd ...
-6
votes
1answer
64 views

Can anyone help me in bulkyfying this trigger?

trigger CPCompetitor on Opportunity (after insert,after update) { List<SP_Product_Item__c> spproduct = new List<SP_Product_Item__c>(); List<Id> accId =new List<Id>(); ...
1
vote
2answers
69 views

Approaches to Bulk Testing Code

I've recently done a refactor of a org's code base and in bulk testing I initially used the dataloader to insert records, however for testing updates I decided to try using the execute anonymous tool ...
1
vote
1answer
118 views

How to sum up opportunities on a contact field?

I'm working for a non-profit organisation who wants know the total amount of opportunities related to a contact directly on the contact layout. Moreover, they want to avoid using APEX. So my idea by ...
0
votes
2answers
415 views

Fire Trigger Only When Stages Moves to Closed Won

I have the trigger class below and I would like it to fire only when an Opportunity Stage is changed to Closed Won. Can anyone help me figure out how to do this? I have an if statement, but it fires ...
0
votes
2answers
760 views

Problem with adderror method

Below is the scenario, I have wrote a trigger which on updating the account program status, updates the Opportunity stage name which in turns fire another trigger which clones another another ...
0
votes
1answer
25 views

How would i bulk this? [closed]

List<Account> acctList = [SELECT Id FROM Account Where Guest_Type__c = NULL LIMIT 100]; for(Account acct :acctList){ acct.Guest_Type__C = 'Conference'; acct.Segment_1__C = '24 Hour ...
0
votes
2answers
55 views

Help me to Get Bulkifying trigger [duplicate]

My Trigger is here. Invoice is custom Object which have Look up relationship with Account. Help me with bulkifying this Trigger. trigger InvAmountUpdate on Invoice__c (After Update) { ...
1
vote
1answer
42 views

I need to write a bulkify trigger for this trigger how should i regret as bulkify for this?

trigger objAobjBnameaddedinobjC on Object_C__c (before insert) { for(Object_C__c c : trigger.new) { Object_A__c a; Object_B__c b; a = [select id, name, Type__c from Object_A__c where ...
1
vote
1answer
147 views

bulk and the MilestoneTriggerTimeCalculator interface

New from Spring '14 is the MilestoneTriggerTimeCalculator interface. (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_interface_support_milestonetriggertimecalculator.htm) We use ...
0
votes
0answers
73 views

Bulkifying class so it will update multiple records

ive got some code ive created which i need to update multiple different records with a unique service_id__c, currently the way we do is through a query but we need a create its own class and it ...
4
votes
2answers
73 views

Will SFDC manufacture batches from concurrent operations?

So, like all SFDC developers worth his/her salt, I know when writing triggers and other code, we need to bulkify. And I have a pretty good handle on how to do that, so I am not asking about that. ...
1
vote
3answers
1k views

System.LimitException: Too Many SOQL Queries: 101 in Trigger

Following is my trigger I get the following error System.LimitException: Too Many SOQL Queries: 101 in Trigger Here is my trigger trigger SubscriberUpdateTrigger on Subscriber__c (after Insert, ...
0
votes
3answers
174 views

Bulkify code with Map

I'm still new to map Usage.. How could this code be bulkified? trigger OppyStatusCheck on Opportunity (before insert, before update) { for(Opportunity opp : Trigger.new) { ...
25
votes
2answers
6k 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 ...
0
votes
1answer
115 views

Bulkifying Code For a Callout

I have a trigger on EmailMessage. I have to get the subject of the case created from the email message. From the subject I am calling an APi to get the language and then updating it to the case ...
0
votes
1answer
57 views

Code Bulkification Problem

I have a requirement to bulkify the code. The trigger is present on Case Object and I have to take the CaseTeamTemplate Id's whose names match with the CaseTeamTemplate objects. I have written this ...
0
votes
2answers
179 views

If statement in trigger causes Too many SOQL Queries

I've got an Opportunity after insert trigger and utility class that creates a Contact, Opportunity Contact Role and Campaign Member (whilst checking to see if the email already exists in which case ...
1
vote
2answers
2k 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 ...
2
votes
3answers
416 views

Bulkifying trigger to update lookup field using trigger

I have one trigger which is working exactly how i wanted it to be but the problem is it is not bulkified can somebody help with that Sales order is child object and Target_V2__c is parent, based on ...