The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
27 views

Create list of Master-Objects for Detail-CustomObject and add Lookup to Detail

I want to create a Lead, based on the data in my custom Object ProductionOrganizer__c. The ProductionOrganizer has a lookup-field AttachedLeadId__c where it can be linked with a lead. Now when ...
1
vote
2answers
34 views

How to manage multiple data in input with a Bulk

I've got this problem to solve. I've an apex batch that updates some records all together when a condition is verified. This triggers a Process builder that calls an Apex Class or whatever it might ...
1
vote
1answer
56 views

How does a trigger behave

Assume I have written a after insert trigger on an object A. I do some manipulation inside my trigger and at the end I create 3 to 4 new objects , that is a related list in Object A(Master-detail ...
3
votes
0answers
34 views

SOQL returning last modified contact matching each email address in set

I am trying to bulkify a trigger to match transactions with contacts by email address. There are many contacts with duplicate email addresses and getting rid of these duplicates is not an option. I am ...
2
votes
2answers
29 views

Trigger Help: Update Custom Email Field based on Value in Lookup Field (Lookup to User) Using Trigger

I am new to Apex and would like to practice updating a custom email field which derives its value based on a custom lookup field. I understand this can be done with a simple formula, but want to ...
1
vote
1answer
29 views

Help bulkify this code for Contact to Account mapping

I have a code (below) that I tried to bulkify based on various online readings, but I want to confirm with the experts here that I have done it correctly. What I have is the following: I have a ...
1
vote
1answer
705 views

Bulkify the code?

I want to clone the Opportunity record if some conditions satisfied in Opportunity car set which is in related list. Opportunity (Master)--->Opportunity car set(Child) My below code is working ...
1
vote
2answers
45 views

Too Many SOQL Queries: 101 - trigger

I am getting error message and I believe it to be error with this trigger. I am new to coding and this was done previously so any assistance is greatly appreciated trigger setAttendeeNumbers on ...
2
votes
1answer
177 views

Trigger Best Practices

How would you rewrite the following trigger to follow best practices re: bulkification, etc? trigger Order_PopulateGallery on RH_Order__c (before insert, before update){ List<Account> accs = ...
1
vote
1answer
40 views

Process Builder vs Apex Trigger

I had the following two requirements to implement. Change account type field on account as soon as a first opportunity is added to that account. Change account type field on account as soon as ...
2
votes
3answers
36 views

Choosing Bulk Count in test classes

Salesforce recommends that we test the code in bulk, especially triggers. So we are expected to insert, update and delete records in bulk inside the test classes as per good coding standards. My query ...
1
vote
0answers
35 views

Is this a fair bulkification of getContentasPDF?

I have to bulkify a handler which utilizes getContentasPDF method. Initially I was passing only single record id in the future method. Now I am passing set<Id> as parameter in savePDF which is a ...
0
votes
0answers
25 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
44 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
21 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
65 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
48 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
129 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
69 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
233 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
15 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
135 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
41 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
72 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
52 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
205 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
33 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
28 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
114 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
90 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
108 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
209 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
129 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
1k 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) { ...
14
votes
1answer
632 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
65 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
40 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
202 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
65 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
92 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
152 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
541 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 ...
1
vote
2answers
1k views

Problem with adderror method

I 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 opportunity. The trigger which is ...
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
57 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) { ...