The recursion tag has no usage guidance.
5
votes
1answer
128 views
CheckRecursion class not working
I predicted we would run into recursive triggers with a project that we are currently working on. To pre-empt this, I searched for solutions and came across this:
Avoiding Recursive Triggers
I ...
3
votes
1answer
29 views
Insert OpportunityLineItem - Error
I am trying to automate the following functionality: When an opportunity stage becomes 'Pending Payment', insert 2 'OpportunityLineItems' using 2 predefined Products.
This is my current code. I am ...
1
vote
1answer
110 views
maximum trigger depth exceeded Opportunity trigger event AfterUpdate for [006R0000009RdT1]
The Trigger below i'm getting error when my IF statement has more that 2 conditions, I Understand it is a recursion issue. However not sure how to fix this, so i can include all the conditions below ...
0
votes
1answer
43 views
Static variable used for Recurssion check
Scenario:
I have two objects - Object A and Object B.Object A has recursion checking mechanism using Static Boolean variables covering different events(IsBeforeUpdate,IsBeforeInsert etc..)
I have two ...
0
votes
1answer
109 views
error when trying to approve request
hello i created a trigger who auto submit the approval request into the approval process. when i create opportunity with the entry criteria of the trigger and the procces i get to approval requeset if ...
0
votes
3answers
69 views
RecursiveCheck prevents trigger from running during tests
I am writing a test class to a handler class called from a trigger. And due to recursive trigger I had to implement CheckRecursive in the trigger and this works fine, until I start testing. Then the ...
3
votes
0answers
71 views
Process Builder: how to make recursion work
I have a number of Process Builder processes on the Case record, which do various field updates. I am aware that I cannot control the order in which these fire, but some of the processes are ...
6
votes
4answers
193 views
best way to handler trigger Recursive call
Below is my code snippet that I have used. And also I used static Boolean to handle the recursive call.
But when I update more than 200 records then trigger only process first 200 record not all the ...
3
votes
2answers
45 views
Why is my Update trigger executing before Insert trigger?
In the attached debug screenshot, you can see that - according to the CODE_UNIT_STARTED and FINISHED lines, the execution seems to be going like this:
Record A is inserted
CODE_UNIT_STARTED: ...
0
votes
1answer
33 views
Control not entering the handler class
I have written an after update trigger on the Content Version and I have used a boolean to check recursion
Handler :
public Class checkRecursive {
private static boolean run = true;
public ...
0
votes
0answers
32 views
Impossible Null Pointer Error on Recursive Method
I have a class that is giving me an error that seems to be impossible. I'm guessing that my error is somewhere else in the code but I can't get my mind around the issue. Can anyone please take a look ...
4
votes
3answers
110 views
Static variables across multiple triggers in same context
So I like many of you am using the static variable "trick" to prevent recursion in my triggers.
But I have one object with many triggers on it all of which are using the method outlined here
https://...
-2
votes
1answer
44 views
Recursive Trigger with one example [duplicate]
Can anyone explain me how to stop recursive triggers with an example?
2
votes
2answers
104 views
How to handle trigger recursion
I have two objects A(parent) and B(child) related by a lookup relationship. I need to update records in object A using data loader. There is an after update trigger on object A which updates some ...
0
votes
2answers
79 views
Recursion in Triggers
I believe I'm having some issues with recursion. My Opportunity trigger creates an engagement object whenever the stage attribute reaches a predetermined value. When the engagement is created I want ...
2
votes
2answers
341 views
Test coverage in recursive scenario
I have an afterupdate trigger which was getting executed twice upon update of a field as well as fieldupdate action through workflow. In order to stop this, I had to use recursive stopping mechanism ...
1
vote
2answers
169 views
Avoid recursion in trigger - handling multiple triggers
I'm using this sample code from Developerforce to avoid recursion in triggers.
public class TriggerMonitor {
private static boolean run = true;
public static boolean runOnce() {
if( ...
1
vote
2answers
292 views
Recursively displaying a map of lists on a Visualforce page
I'm trying to create a customized version of the campaign hierarchy page, allowing for the display of additional data other than just campaign names. I have a Map<ID, List<Campaign>> keyed ...
1
vote
2answers
181 views
How to update parent object in trigger without risking recursive update loops
I have several custom fields on the Account object that serve as rollup counts of specific Activities, e.g. Open Task Count, Completed Task Count, etc. I fill these fields via an after trigger on the ...
4
votes
1answer
711 views
Trigger/Workflow Rule Recursion on Opportunity and LineItem
We have a trigger on Opportunity that updates the OpportunityLineItem when the Opportunity is won. We also have workflow rules on the OpportunityLineItem that fire and this causes some recursion to ...
9
votes
3answers
671 views
Checking 'Correct' Previous value method in Trigger design best practice
One of the most common questions on this forum is around trigger recursion. There are a few standard ways to prevent recursion. My method of choice when it comes to checking for field changes, is ...
4
votes
1answer
128 views
Which DML Events Cause Trigger Recursion
I am curious, besides the UPDATE DML event causing trigger recursion (an update causing another update due to a field update), what other scenarios can result in trigger recursion.
I would like to ...
1
vote
1answer
1k views
Static Boolean Property Getting set to 'TRUE' by default
Well, they say that no platform is perfect, and Salesforce definitely has its share of quirks. Here's one more.
I have the following structure:
Trigger on Lead:
//some random code
system.debug(...
1
vote
3answers
80 views
Can interdependent Rollups, Formulas and Triggers cause hard to reproduce bugs?
Let me try to ask this with out explaining my overly complicated case in detail. I have custom objects that heavily use formulas, rollup summaries and triggers.
For the last days I am chasing hard to ...
1
vote
3answers
461 views
How can I edit this trigger to only fire once?
The trigger creates a related record when a checkbox is updated. The problem is it is creating a new related record everytime the record is edited. I want to edit the trigger to only create the ...
7
votes
2answers
5k views
How to avoid recursive trigger other than the classic 'class w/ static variable' pattern?
How can we avoid trigger get executed again and again (recursive trigger)? One way is to have a class with static variable and have boolean value and check it is true or false and changing the boolean ...