function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AMR27AMR27 

Recursive Update Error on connected Opportunity/Task Triggers

Hello all, 

 

I am having an issue with two triggers I have written.  One trigger creates a task of a certain recordtype whenever a field  on an Opportunity is set to a certain value, while the second trigger assigns some values from this task back to the related opportunity upon update to specific Task fields.

 

This should work without issue, in theory anyway, but it seems as though the two triggers are acting simultaneously (though they should not be).


The error I get is:

 

Error:Apex trigger assignUnscheduledTask caused an unexpected exception, contact your administrator: assignUnscheduledTask: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateUnschedOpp: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 006K0000003dWJPIA2; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006K0000003dWJP) is currently in trigger assignUnscheduledTask, therefore it cannot recursively update itself: [] Trigger.UpdateUnschedOpp: line 19, column 1: []: Trigger.assignUnscheduledTask: line 25, column 1

 

The initial trigger is :

 

trigger assignUnscheduledTask on Opportunity (before update, before insert) {

    public Task tsk {get; set;}
    
Recordtype RT = [select Id, Name from RecordType where sObjectType = 'Task' AND Name = 'Un-Scheduled Deal Task'];
 
    for (Opportunity o : trigger.new) {
        
               system.debug('CREATE NEW TASK FOR ' + o.id);
           
             if (o.Deal_Queue_Status__c == 'DNR') {
             
             
                System.debug('triggerfire');
                tsk = new Task(
                  
                    whatid=o.Id,
                    OwnerId=o.ownerid,
                    Subject='ACTION REQUIRED - Your Signed Merchant has been UNSCHEDULED',
                    RecordTypeId = RT.Id
                    
                    );
         insert tsk;
         
         
                 }
     
   
    
    
    }


}

 And the follow up trigger is 

 

trigger UpdateUnschedOpp on Task (before update) {
          

  if(Trigger.new.size() == 1 ) {

    Task tk = Trigger.New[0];
    String str = tk.whatid;
    if(str != null && str.substring(0,3)== '006')
    {

        Opportunity opp = [select Id, Merchant_willing_to_run__c, Requested_Run_Month__c  from Opportunity where Id = :tk.WhatId ];

        List<Task> tsks = [Select Merchant_willing_to_run__c, Requested_Run_Month__c From Task where whatid=:tk.whatid and  what.type = 'Opportunity' and isClosed  = false and Merchant_willing_to_run__c != null];  

        if (tsks.size()>0) {
                opp.Merchant_willing_to_run__c = tsks[0].Merchant_willing_to_run__c;
                opp.Requested_Run_Month__c  = tsks[0].Requested_Run_Month__c;
        }
        update opp;
    }
}
}

 Any help at all would be great, I am at an impasse and need to figure this out ASAP.

 

Thanks a lot all!

 

Alex Roth

steve456steve456

First :  take out the "update opp "  in the 2nd trigger... it will work

 

 

second if doesnt

 

Go to the debug logs ,open the last log....search for the part of your error....see which trigger is obstructing it .....Next if its not that go to the workflows and check the workflows on the object.Deactivate the particular workflow it should work 4 sure..........

steve456steve456

did it work..????

AMR27AMR27

Steve,

 

If I take the update opp part out of the second trigger then it does not update the opportunity as I need the trigger to do.

 

If I take out update from the initial trigger, then the initial trigger will never fire, as records are never inserted with a field value as such.


I am looking into any workflows that may be firing, but it doesn;t seem as though this is the issue.

 

Thanks for the effort though -

 

Alex

steve456steve456

ya it will update...........dont worry........take out the update opp in 2nd trigger because you are writing on a before update trigger it will

steve456steve456

check other triggers on this object where you r updating the saame obj twice

AMR27AMR27

Steve,

 

Here is the debug log, it fires several triggers, but the issue seems to stem from these two that I have afforementioned -

 

 

23.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
16:31:44.226 (226926000)|EXECUTION_STARTED
16:31:44.226 (226965000)|CODE_UNIT_STARTED|[EXTERNAL]|TRIGGERS
16:31:44.226 (226997000)|CODE_UNIT_STARTED|[EXTERNAL]|01qK0000000Cesq|UpdateUnschedOpp on Task trigger event BeforeUpdate for [00TK0000003L1rX]
16:31:44.228 (228285000)|SYSTEM_METHOD_ENTRY|[4]|LIST.size()
16:31:44.228 (228820000)|SYSTEM_METHOD_EXIT|[4]|LIST.size()
16:31:44.230 (230644000)|SOQL_EXECUTE_BEGIN|[11]|Aggregations:0|select Id, Merchant_willing_to_run__c, Requested_Run_Month__c from Opportunity where Id = :tmpVar1
16:31:44.235 (235646000)|SOQL_EXECUTE_END|[11]|Rows:1
16:31:44.236 (236918000)|SOQL_EXECUTE_BEGIN|[13]|Aggregations:0|select Merchant_willing_to_run__c, Requested_Run_Month__c from Task where (whatid = :tmpVar1 and what.type = 'Opportunity' and isClosed = false and Merchant_willing_to_run__c != null)
16:31:44.245 (245431000)|SOQL_EXECUTE_END|[13]|Rows:1
16:31:44.245 (245499000)|SYSTEM_METHOD_ENTRY|[15]|LIST.size()
16:31:44.245 (245547000)|SYSTEM_METHOD_EXIT|[15]|LIST.size()
16:31:44.245 (245760000)|DML_BEGIN|[19]|Op:Update|Type:Opportunity|Rows:1
16:31:44.352 (352648000)|CODE_UNIT_STARTED|[EXTERNAL]|01qF0000000toeJ|UpdateMerchantAdvocateEmail on Opportunity trigger event BeforeUpdate for [006K0000002HQAR]
16:31:44.353 (353672000)|SOQL_EXECUTE_BEGIN|[14]|Aggregations:0|select Id from UserRole where Name = 'Deal Quality Manager'
16:31:44.357 (357866000)|SOQL_EXECUTE_END|[14]|Rows:1
16:31:44.358 (358448000)|SOQL_EXECUTE_BEGIN|[16]|Aggregations:0|select Id, Name from User where UserRoleId = :tmpVar1
16:31:44.362 (362312000)|SOQL_EXECUTE_END|[16]|Rows:2
16:31:44.363 (363731000)|METHOD_ENTRY|[1]|01pK0000000Cy9S|ExecuteMAemailOnce.ExecuteMAemailOnce()
16:31:44.363 (363780000)|METHOD_EXIT|[1]|ExecuteMAemailOnce
16:31:44.363 (363960000)|SYSTEM_METHOD_ENTRY|[28]|LIST.size()
16:31:44.364 (364013000)|SYSTEM_METHOD_EXIT|[28]|LIST.size()
16:31:44.364 (364096000)|SYSTEM_METHOD_ENTRY|[30]|LIST.size()
16:31:44.364 (364144000)|SYSTEM_METHOD_EXIT|[30]|LIST.size()
16:31:44.364 (364276000)|SYSTEM_METHOD_ENTRY|[34]|SET.add(ANY)
16:31:44.364 (364324000)|SYSTEM_METHOD_EXIT|[34]|SET.add(ANY)
16:31:44.364 (364424000)|SYSTEM_METHOD_ENTRY|[35]|SET.add(ANY)
16:31:44.364 (364466000)|SYSTEM_METHOD_EXIT|[35]|SET.add(ANY)
16:31:44.364 (364589000)|SYSTEM_METHOD_ENTRY|[30]|LIST.size()
16:31:44.364 (364604000)|SYSTEM_METHOD_EXIT|[30]|LIST.size()
16:31:44.364 (364651000)|SYSTEM_METHOD_ENTRY|[47]|String.valueOf(Object)
16:31:44.364 (364708000)|SYSTEM_METHOD_EXIT|[47]|String.valueOf(Object)
16:31:44.364 (364748000)|SYSTEM_METHOD_ENTRY|[47]|System.debug(ANY)
16:31:44.364 (364764000)|USER_DEBUG|[47]|DEBUG|MARKETS ARE {null, a0qK00000000Mx0IAE}
16:31:44.364 (364773000)|SYSTEM_METHOD_EXIT|[47]|System.debug(ANY)
16:31:44.365 (365521000)|SOQL_EXECUTE_BEGIN|[49]|Aggregations:0|select Id, Merchant_Account_Manager__c, Region__c, Merchant_Account_Manager__r.Title, Merchant_Advocate__r.Title, Merchant_Advocate__c, Production_Coordinator__c, Traffic_Coordinator__c, Gift_Box_Coordinator__c, National_Traffic_Coordinator__c from Markets__c where Id = :tmpVar1
16:31:44.370 (370090000)|SOQL_EXECUTE_END|[49]|Rows:1
16:31:44.370 (370190000)|SYSTEM_METHOD_ENTRY|[52]|LIST.iterator()
16:31:44.370 (370438000)|SYSTEM_METHOD_EXIT|[52]|LIST.iterator()
16:31:44.370 (370479000)|SYSTEM_METHOD_ENTRY|[52]|system.ListIterator.hasNext()
16:31:44.370 (370498000)|SYSTEM_METHOD_EXIT|[52]|system.ListIterator.hasNext()
16:31:44.370 (370520000)|SYSTEM_METHOD_ENTRY|[52]|system.ListIterator.next()
16:31:44.370 (370551000)|SYSTEM_METHOD_EXIT|[52]|system.ListIterator.next()
16:31:44.370 (370630000)|SYSTEM_METHOD_ENTRY|[54]|MAP.put(ANY, ANY)
16:31:44.370 (370683000)|SYSTEM_METHOD_EXIT|[54]|MAP.put(ANY, ANY)
16:31:44.370 (370721000)|SYSTEM_METHOD_ENTRY|[55]|SET.add(ANY)
16:31:44.370 (370760000)|SYSTEM_METHOD_EXIT|[55]|SET.add(ANY)
16:31:44.370 (370771000)|SYSTEM_METHOD_ENTRY|[52]|system.ListIterator.hasNext()
16:31:44.370 (370789000)|SYSTEM_METHOD_EXIT|[52]|system.ListIterator.hasNext()
16:31:44.370 (370820000)|SYSTEM_METHOD_ENTRY|[60]|String.valueOf(Object)
16:31:44.370 (370868000)|SYSTEM_METHOD_EXIT|[60]|String.valueOf(Object)
16:31:44.370 (370888000)|SYSTEM_METHOD_ENTRY|[60]|System.debug(ANY)
16:31:44.370 (370900000)|USER_DEBUG|[60]|DEBUG|REGIONALREGIONIDS ARE {null}
16:31:44.370 (370908000)|SYSTEM_METHOD_EXIT|[60]|System.debug(ANY)
16:31:44.370 (370930000)|SYSTEM_METHOD_ENTRY|[62]|SET.size()
16:31:44.370 (370967000)|SYSTEM_METHOD_EXIT|[62]|SET.size()
16:31:44.370 (370994000)|SYSTEM_METHOD_ENTRY|[69]|SET.size()
16:31:44.371 (371026000)|SYSTEM_METHOD_EXIT|[69]|SET.size()
16:31:44.371 (371398000)|SOQL_EXECUTE_BEGIN|[71]|Aggregations:0|select Id, Regional_Traffic_Coordinator__c from Region__c where ID = :tmpVar1
16:31:44.372 (372570000)|SOQL_EXECUTE_END|[71]|Rows:0
16:31:44.372 (372656000)|SYSTEM_METHOD_ENTRY|[76]|String.valueOf(Object)
16:31:44.372 (372708000)|SYSTEM_METHOD_EXIT|[76]|String.valueOf(Object)
16:31:44.372 (372727000)|SYSTEM_METHOD_ENTRY|[76]|System.debug(ANY)
16:31:44.372 (372739000)|USER_DEBUG|[76]|DEBUG|SRMCREGIONS ARE ()
16:31:44.372 (372747000)|SYSTEM_METHOD_EXIT|[76]|System.debug(ANY)
16:31:44.372 (372772000)|SYSTEM_METHOD_ENTRY|[78]|LIST.size()
16:31:44.372 (372811000)|SYSTEM_METHOD_EXIT|[78]|LIST.size()
16:31:44.372 (372841000)|SYSTEM_METHOD_ENTRY|[88]|LIST.size()
16:31:44.372 (372875000)|SYSTEM_METHOD_EXIT|[88]|LIST.size()
16:31:44.372 (372903000)|SYSTEM_METHOD_ENTRY|[99]|String.valueOf(Object)
16:31:44.372 (372944000)|SYSTEM_METHOD_EXIT|[99]|String.valueOf(Object)
16:31:44.372 (372963000)|SYSTEM_METHOD_ENTRY|[99]|System.debug(ANY)
16:31:44.372 (372974000)|USER_DEBUG|[99]|DEBUG|REGIONCOORDINATORS ARE {}
16:31:44.372 (372982000)|SYSTEM_METHOD_EXIT|[99]|System.debug(ANY)
16:31:44.373 (373003000)|SYSTEM_METHOD_ENTRY|[100]|String.valueOf(Object)
16:31:44.373 (373076000)|SYSTEM_METHOD_EXIT|[100]|String.valueOf(Object)
16:31:44.373 (373104000)|SYSTEM_METHOD_ENTRY|[100]|System.debug(ANY)
16:31:44.373 (373121000)|USER_DEBUG|[100]|DEBUG|ADVOCATES ARE {a0qK00000000Mx0IAE=Markets__c:{Id=a0qK00000000Mx0IAE}}
16:31:44.373 (373132000)|SYSTEM_METHOD_EXIT|[100]|System.debug(ANY)
16:31:44.373 (373155000)|SYSTEM_METHOD_ENTRY|[101]|String.valueOf(Object)
16:31:44.373 (373197000)|SYSTEM_METHOD_EXIT|[101]|String.valueOf(Object)
16:31:44.373 (373215000)|SYSTEM_METHOD_ENTRY|[101]|System.debug(ANY)
16:31:44.373 (373226000)|USER_DEBUG|[101]|DEBUG|ESCAPES COORDINATORS ARE {}
16:31:44.373 (373234000)|SYSTEM_METHOD_EXIT|[101]|System.debug(ANY)
16:31:44.373 (373314000)|SYSTEM_METHOD_ENTRY|[103]|LIST.size()
16:31:44.373 (373353000)|SYSTEM_METHOD_EXIT|[103]|LIST.size()
16:31:44.373 (373431000)|SYSTEM_METHOD_ENTRY|[105]|LIST.iterator()
16:31:44.373 (373559000)|SYSTEM_METHOD_EXIT|[105]|LIST.iterator()
16:31:44.373 (373593000)|SYSTEM_METHOD_ENTRY|[105]|system.ListIterator.hasNext()
16:31:44.373 (373609000)|SYSTEM_METHOD_EXIT|[105]|system.ListIterator.hasNext()
16:31:44.373 (373630000)|SYSTEM_METHOD_ENTRY|[105]|system.ListIterator.next()
16:31:44.373 (373645000)|SYSTEM_METHOD_EXIT|[105]|system.ListIterator.next()
16:31:44.373 (373745000)|SYSTEM_METHOD_ENTRY|[109]|System.debug(ANY)
16:31:44.373 (373790000)|USER_DEBUG|[109]|DEBUG|PRIMARY MARKET IS a0qK00000000Mx0
16:31:44.373 (373802000)|SYSTEM_METHOD_EXIT|[109]|System.debug(ANY)
16:31:44.373 (373844000)|SYSTEM_METHOD_ENTRY|[115]|MAP.get(ANY)
16:31:44.373 (373891000)|SYSTEM_METHOD_EXIT|[115]|MAP.get(ANY)
16:31:44.373 (373961000)|SYSTEM_METHOD_ENTRY|[115]|System.debug(ANY)
16:31:44.373 (373976000)|USER_DEBUG|[115]|DEBUG|TITLE IS null
16:31:44.373 (373985000)|SYSTEM_METHOD_EXIT|[115]|System.debug(ANY)
16:31:44.374 (374021000)|SYSTEM_METHOD_ENTRY|[117]|MAP.get(ANY)
16:31:44.374 (374069000)|SYSTEM_METHOD_EXIT|[117]|MAP.get(ANY)
16:31:44.374 (374181000)|SYSTEM_METHOD_ENTRY|[118]|MAP.get(ANY)
16:31:44.374 (374231000)|SYSTEM_METHOD_EXIT|[118]|MAP.get(ANY)
16:31:44.374 (374318000)|SYSTEM_METHOD_ENTRY|[119]|MAP.get(ANY)
16:31:44.374 (374367000)|SYSTEM_METHOD_EXIT|[119]|MAP.get(ANY)
16:31:44.374 (374450000)|SYSTEM_METHOD_ENTRY|[120]|MAP.get(ANY)
16:31:44.374 (374499000)|SYSTEM_METHOD_EXIT|[120]|MAP.get(ANY)
16:31:44.374 (374582000)|SYSTEM_METHOD_ENTRY|[121]|MAP.get(ANY)
16:31:44.374 (374630000)|SYSTEM_METHOD_EXIT|[121]|MAP.get(ANY)
16:31:44.374 (374692000)|SYSTEM_METHOD_ENTRY|[105]|system.ListIterator.hasNext()
16:31:44.374 (374710000)|SYSTEM_METHOD_EXIT|[105]|system.ListIterator.hasNext()
16:31:44.413 (374742000)|CUMULATIVE_LIMIT_USAGE
16:31:44.413|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 6 out of 100
  Number of query rows: 6 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 1 out of 150
  Number of DML rows: 1 out of 10000
  Number of script statements: 48 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

16:31:44.413|CUMULATIVE_LIMIT_USAGE_END

16:31:44.374 (374836000)|CODE_UNIT_FINISHED|UpdateMerchantAdvocateEmail on Opportunity trigger event BeforeUpdate for [006K0000002HQAR]
16:31:44.377 (377546000)|CODE_UNIT_STARTED|[EXTERNAL]|01qK0000000CeVm|updateMerchantTeamLeadEmail on Opportunity trigger event BeforeUpdate for [006K0000002HQAR]
16:31:44.379 (379171000)|METHOD_ENTRY|[1]|01pK0000000CyvH|ExecuteMTLemailOnce.ExecuteMTLemailOnce()
16:31:44.379 (379202000)|METHOD_EXIT|[1]|ExecuteMTLemailOnce
16:31:44.379 (379287000)|SYSTEM_METHOD_ENTRY|[12]|LIST.iterator()
16:31:44.379 (379423000)|SYSTEM_METHOD_EXIT|[12]|LIST.iterator()
16:31:44.379 (379458000)|SYSTEM_METHOD_ENTRY|[12]|system.ListIterator.hasNext()
16:31:44.379 (379475000)|SYSTEM_METHOD_EXIT|[12]|system.ListIterator.hasNext()
16:31:44.379 (379496000)|SYSTEM_METHOD_ENTRY|[12]|system.ListIterator.next()
16:31:44.379 (379511000)|SYSTEM_METHOD_EXIT|[12]|system.ListIterator.next()
16:31:44.379 (379602000)|SYSTEM_METHOD_ENTRY|[14]|SET.add(ANY)
16:31:44.379 (379648000)|SYSTEM_METHOD_EXIT|[14]|SET.add(ANY)
16:31:44.379 (379659000)|SYSTEM_METHOD_ENTRY|[12]|system.ListIterator.hasNext()
16:31:44.379 (379672000)|SYSTEM_METHOD_EXIT|[12]|system.ListIterator.hasNext()
16:31:44.380 (380144000)|SOQL_EXECUTE_BEGIN|[19]|Aggregations:0|select Id, Merchant_Team_Lead_Email__c, Merchant_Team_Lead__c from Account where Id = :tmpVar1
16:31:44.389 (389659000)|SOQL_EXECUTE_END|[19]|Rows:1
16:31:44.389 (389752000)|SYSTEM_METHOD_ENTRY|[23]|LIST.iterator()
16:31:44.389 (389894000)|SYSTEM_METHOD_EXIT|[23]|LIST.iterator()
16:31:44.389 (389929000)|SYSTEM_METHOD_ENTRY|[23]|system.ListIterator.hasNext()
16:31:44.389 (389946000)|SYSTEM_METHOD_EXIT|[23]|system.ListIterator.hasNext()
16:31:44.389 (389971000)|SYSTEM_METHOD_ENTRY|[23]|system.ListIterator.next()
16:31:44.390 (390000000)|SYSTEM_METHOD_EXIT|[23]|system.ListIterator.next()
16:31:44.390 (390025000)|SYSTEM_METHOD_ENTRY|[23]|system.ListIterator.hasNext()
16:31:44.390 (390039000)|SYSTEM_METHOD_EXIT|[23]|system.ListIterator.hasNext()
16:31:44.390 (390123000)|SYSTEM_METHOD_ENTRY|[34]|LIST.iterator()
16:31:44.390 (390248000)|SYSTEM_METHOD_EXIT|[34]|LIST.iterator()
16:31:44.390 (390285000)|SYSTEM_METHOD_ENTRY|[34]|system.ListIterator.hasNext()
16:31:44.390 (390300000)|SYSTEM_METHOD_EXIT|[34]|system.ListIterator.hasNext()
16:31:44.390 (390321000)|SYSTEM_METHOD_ENTRY|[34]|system.ListIterator.next()
16:31:44.390 (390336000)|SYSTEM_METHOD_EXIT|[34]|system.ListIterator.next()
16:31:44.390 (390379000)|SYSTEM_METHOD_ENTRY|[36]|MAP.get(ANY)
16:31:44.390 (390426000)|SYSTEM_METHOD_EXIT|[36]|MAP.get(ANY)
16:31:44.390 (390470000)|SYSTEM_METHOD_ENTRY|[34]|system.ListIterator.hasNext()
16:31:44.390 (390487000)|SYSTEM_METHOD_EXIT|[34]|system.ListIterator.hasNext()
16:31:44.429 (390516000)|CUMULATIVE_LIMIT_USAGE
16:31:44.429|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 7 out of 100
  Number of query rows: 7 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 1 out of 150
  Number of DML rows: 1 out of 10000
  Number of script statements: 59 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

16:31:44.429|CUMULATIVE_LIMIT_USAGE_END

16:31:44.390 (390589000)|CODE_UNIT_FINISHED|updateMerchantTeamLeadEmail on Opportunity trigger event BeforeUpdate for [006K0000002HQAR]
16:31:44.393 (393410000)|CODE_UNIT_STARTED|[EXTERNAL]|01qK0000000CeTM|assignUnscheduledTask on Opportunity trigger event BeforeUpdate for [006K0000002HQAR]
16:31:44.393 (393724000)|METHOD_ENTRY|[3]|01qK0000000CeTM|assignUnscheduledTask.__sfdc_tsk(Task)
16:31:44.393 (393778000)|METHOD_EXIT|[3]|01qK0000000CeTM|assignUnscheduledTask.__sfdc_tsk(Task)
16:31:44.394 (394121000)|SOQL_EXECUTE_BEGIN|[6]|Aggregations:0|select Id, Name from RecordType where (sObjectType = 'Task' and Name = 'Un-Scheduled Deal Task')
16:31:44.397 (397991000)|SOQL_EXECUTE_END|[6]|Rows:1
16:31:44.398 (398209000)|SYSTEM_METHOD_ENTRY|[8]|LIST.iterator()
16:31:44.398 (398352000)|SYSTEM_METHOD_EXIT|[8]|LIST.iterator()
16:31:44.398 (398386000)|SYSTEM_METHOD_ENTRY|[8]|system.ListIterator.hasNext()
16:31:44.398 (398407000)|SYSTEM_METHOD_EXIT|[8]|system.ListIterator.hasNext()
16:31:44.398 (398429000)|SYSTEM_METHOD_ENTRY|[8]|system.ListIterator.next()
16:31:44.398 (398444000)|SYSTEM_METHOD_EXIT|[8]|system.ListIterator.next()
16:31:44.398 (398500000)|SYSTEM_METHOD_ENTRY|[10]|String.valueOf(Object)
16:31:44.398 (398547000)|SYSTEM_METHOD_EXIT|[10]|String.valueOf(Object)
16:31:44.398 (398568000)|SYSTEM_METHOD_ENTRY|[10]|System.debug(ANY)
16:31:44.398 (398581000)|USER_DEBUG|[10]|DEBUG|CREATE NEW TASK FOR 006K0000002HQARIA4
16:31:44.398 (398590000)|SYSTEM_METHOD_EXIT|[10]|System.debug(ANY)
16:31:44.398 (398662000)|SYSTEM_METHOD_ENTRY|[15]|System.debug(ANY)
16:31:44.398 (398701000)|USER_DEBUG|[15]|DEBUG|triggerfire
16:31:44.398 (398712000)|SYSTEM_METHOD_EXIT|[15]|System.debug(ANY)
16:31:44.399 (399285000)|METHOD_ENTRY|[16]|01qK0000000CeTM|assignUnscheduledTask.__sfdc_tsk(Task)
16:31:44.399 (399336000)|METHOD_EXIT|[16]|01qK0000000CeTM|assignUnscheduledTask.__sfdc_tsk(Task)
16:31:44.399 (399419000)|DML_BEGIN|[24]|Op:Insert|Type:Task|Rows:1
16:31:44.476 (476183000)|ENTERING_MANAGED_PKG|FonalityUAE
16:31:44.499 (499720000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Task
16:31:44.511 (511112000)|WF_RULE_EVAL_BEGIN|Assignment
16:31:44.511 (511139000)|WF_RULE_EVAL_BEGIN|Response
16:31:44.511 (511151000)|WF_RULE_EVAL_BEGIN|Workflow
16:31:44.511 (511177000)|WF_CRITERIA_BEGIN|[Task:  00TK0000003L1rw]|Task Type|01QF0000000Puuz|ON_ALL_CHANGES
16:31:44.513 (513240000)|WF_RULE_FILTER|[Task : Type not equal to null]
16:31:44.513 (513267000)|WF_RULE_EVAL_VALUE|Call
16:31:44.513 (513275000)|WF_CRITERIA_END|true
16:31:44.514 (514299000)|WF_SPOOL_ACTION_BEGIN|Workflow
16:31:44.514 (514899000)|WF_FIELD_UPDATE|[Task:  00TK0000003L1rw]|Field:Task: Activity Type|Value:Call|Id=04YF0000000Lljz|CurrentRule:Task Type (Id=01QF0000000Puuz)
16:31:44.514 (514925000)|WF_ACTION| Field Update: 1;
16:31:44.514 (514940000)|WF_RULE_EVAL_BEGIN|Escalation
16:31:44.514 (514947000)|WF_RULE_EVAL_END
16:31:44.516 (516445000)|CODE_UNIT_STARTED|[EXTERNAL]|01qK0000000Cesq|UpdateUnschedOpp on Task trigger event BeforeUpdate for [00TK0000003L1rw]
16:31:44.516 (516646000)|SYSTEM_METHOD_ENTRY|[4]|LIST.size()
16:31:44.516 (516668000)|SYSTEM_METHOD_EXIT|[4]|LIST.size()
16:31:44.517 (517131000)|SOQL_EXECUTE_BEGIN|[11]|Aggregations:0|select Id, Merchant_willing_to_run__c, Requested_Run_Month__c from Opportunity where Id = :tmpVar1
16:31:44.521 (521127000)|SOQL_EXECUTE_END|[11]|Rows:1
16:31:44.522 (522251000)|SOQL_EXECUTE_BEGIN|[13]|Aggregations:0|select Merchant_willing_to_run__c, Requested_Run_Month__c from Task where (whatid = :tmpVar1 and what.type = 'Opportunity' and isClosed = false and Merchant_willing_to_run__c != null)
16:31:44.526 (526854000)|SOQL_EXECUTE_END|[13]|Rows:1
16:31:44.526 (526909000)|SYSTEM_METHOD_ENTRY|[15]|LIST.size()
16:31:44.526 (526926000)|SYSTEM_METHOD_EXIT|[15]|LIST.size()
16:31:44.527 (527074000)|DML_BEGIN|[19]|Op:Update|Type:Opportunity|Rows:1
16:31:44.530 (530661000)|DML_END|[19]
16:31:44.530 (530816000)|EXCEPTION_THROWN|[19]|System.DmlException: Update failed. First exception on row 0 with id 006K0000002HQARIA4; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006K0000002HQAR) is currently in trigger assignUnscheduledTask, therefore it cannot recursively update itself: []
16:31:44.532 (532141000)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 006K0000002HQARIA4; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006K0000002HQAR) is currently in trigger assignUnscheduledTask, therefore it cannot recursively update itself: []

Trigger.UpdateUnschedOpp: line 19, column 1
16:31:44.532 (532165000)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 006K0000002HQARIA4; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006K0000002HQAR) is currently in trigger assignUnscheduledTask, therefore it cannot recursively update itself: []

Trigger.UpdateUnschedOpp: line 19, column 1
16:31:44.571 (532182000)|CUMULATIVE_LIMIT_USAGE
16:31:44.571|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 10 out of 100
  Number of query rows: 10 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 3 out of 150
  Number of DML rows: 3 out of 10000
  Number of script statements: 72 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

16:31:44.571|LIMIT_USAGE_FOR_NS|FonalityUAE|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of script statements: 57 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

16:31:44.571|CUMULATIVE_LIMIT_USAGE_END

16:31:44.532 (532245000)|CODE_UNIT_FINISHED|UpdateUnschedOpp on Task trigger event BeforeUpdate for [00TK0000003L1rw]
steve456steve456

check this trigger once "

updateMerchantTeamLeadEmail
Just inactive the workflows on opportunity and check once