You need to sign in to do that
Don't have an account?
RichaMidha
Maximum Trigger Depth Increased:
I am new to Apex and I am getting the error as Maximum Trigger Depth Increased.
Here is my method:
public static void iterationCloser(list<Milestone1_Project__c> newProjectList)
{
//List<Milestone1_Milestone__c > Iterations = [SELECT Id,Status__c FROM Milestone1_Milestone__c where Project__c= :CurrentProject.Id];
List<Milestone1_Milestone__c > Iterations = [SELECT Id,Status__c FROM Milestone1_Milestone__c where Project__c= :newProjectList];
for (Milestone1_Project__c CurrentProject : newProjectList)
{
System.debug('Project Name:'+ newProjectList);
if(CurrentProject.Status__c=='Completed')
{
System.debug('Iterations:'+ Iterations);
for (Milestone1_Milestone__c CurrentIteration : Iterations) {
// This is current iteration close it
if( currentIteration.Status__c != 'Completed')
{
currentIteration.Status__c = 'Completed';
}
}
System.debug('Iterations:'+ Iterations);
}
}
update Iterations;
}
Here is my method:
public static void iterationCloser(list<Milestone1_Project__c> newProjectList)
{
//List<Milestone1_Milestone__c > Iterations = [SELECT Id,Status__c FROM Milestone1_Milestone__c where Project__c= :CurrentProject.Id];
List<Milestone1_Milestone__c > Iterations = [SELECT Id,Status__c FROM Milestone1_Milestone__c where Project__c= :newProjectList];
for (Milestone1_Project__c CurrentProject : newProjectList)
{
System.debug('Project Name:'+ newProjectList);
if(CurrentProject.Status__c=='Completed')
{
System.debug('Iterations:'+ Iterations);
for (Milestone1_Milestone__c CurrentIteration : Iterations) {
// This is current iteration close it
if( currentIteration.Status__c != 'Completed')
{
currentIteration.Status__c = 'Completed';
}
}
System.debug('Iterations:'+ Iterations);
}
}
update Iterations;
}
Hans Liss
You may need to post the trigger itself as well, and if you have triggers on Milestone1_Milestone__c, you should add those, too.