The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
74 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
75 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
38 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
116 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
28 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
36 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
198 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
57 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
33 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
60 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
50 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
29 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
63 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
140 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
169 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
1answer
32 views

Dynamic update of records of an sobject, given the object name, fields and their types

I have few records in an object say X which has few fields. Now I would get records and object name dynamically with field names and data. I should fetch existing records matching those dynamic ...
0
votes
2answers
51 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
36 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
0answers
84 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
30 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
70 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
503 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
100 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) { ...
17
votes
2answers
4k 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
64 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
49 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
143 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
1answer
1k 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
379 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 ...
1
vote
4answers
662 views

bulkifying trigger

I am trying to bulkify my trigger and looking for help looking for help. It works fine as it is for a single record but need to ensure it works in bulk, so need to bulkify it but not sure how. Also, ...
4
votes
2answers
307 views

Order of records in data load

I have a use case where I need to insert data in salesforce which is being exported from an external system. This data is split over multiple rows, and I need to get those multiple rows into the ...
1
vote
2answers
71 views

Is this a Bulkified trigger?

This is a Trigger working properly where it will fetch Logo__c[Rich Text Area] From Parent Object(Account) and put in Child Record(Contact) Logo__c[Again rich Text Area] trigger Pop_Img on Contact ...
0
votes
3answers
162 views

How do I Bulkify Trigger to populate Opportunity Picklists with Account Picklists

I'm working on a requirement as follows: Whenever an Opportunity is created or edited, its custom region picklists (Region__c) should be overwritten with the Account region picklists (Region__c). ...
9
votes
3answers
415 views

Bulkify on composite SOQL key

Assume I have a list of Objectx__c. Each instance of Objectx__c has a TEXT field SerializedData__c that contains two JSON values detailName and step. The requirement Using the detailName and ...
4
votes
1answer
246 views

Bulk API - Records in different parallel batches not visible in trigger

We're loading thousands of records into a custom object (Address__c) over the Bulk API, in parallel mode. It has a Master-Detail relationship with Contact There's a checkbox field on the object ...
4
votes
1answer
496 views

Bulkifying Apex trigger to handle large set of records updated via data loader

I wrote this trigger to per-form roll up operation on Child (Order line )to Parent (Order) Object related using Lookup field. Basically it sums up the currency amount of all order line records that ...
3
votes
4answers
3k views

Trying to create a trigger to prevent creation of duplicate accounts

This is the trigger i have wrote to prevent the creation of duplicate accounts, i am getting an error message saying "Intial term of field expression must be a concrete SObject:LIST ". Can someone ...
3
votes
2answers
329 views

Test already started: How to do big tests

I'd like to do a massive test. We've got a fairly complex operation that runs on any of 160,000 records, all of which have various scenarios as children and could be crappy data in some cases. I'd ...
0
votes
1answer
640 views

Making a Trigger Bulk Ready

I have a trigger that works just fine for single records and I am stumped how to make it work for multiple records. Any help would be appreciated. trigger TSSEducationUpdate on Education__c (after ...
3
votes
1answer
256 views

Governor limits in relation to System.setPassword

I can't seem to find how to bulkify System.setPassword(Id, String) method to set passwords for multiple users at once. Can it be done? If not, what governor limits I might potentially hit?
2
votes
2answers
167 views

EmailMessage trigger - does it ever happen in bulk?

I need to write some trigger logic under EmailMessage. Out of habit and good coding practice, I did it is "bulkified". However, an interesting thought came to me. Do I really need to make it run in ...
0
votes
2answers
227 views

How to realize bulk entry data for custom objects?

I want to do bulk entry for data in custom objects and wonder what would be the easiest way to do so. I have three objects, Timesheet (the main object), Type and Details. Every Timesheet has ...
5
votes
1answer
986 views

Submit records for approval in bulk without hitting DML Statement limit

I've got code to create and submit for approval a custom object. I'm running into the DML statement limit. As far as I can see each record I submit for approval takes up a DML statement, but there's ...
1
vote
2answers
606 views

Question on Bulkification/Governor Limit of Code

Is the code below ready to handle bulk changes? Is there a limit to how many Accounts I can be bulk updating with this trigger active? Trigger: trigger transferRelationshipTeamFromAcctOnAcctUpdate ...