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
Shannon.ax1730Shannon.ax1730 

Apex script unhandled trigger exception by user/organization

Help! Please...just got about 40 error messages this morning in my inbox with this same error:

 

Apex script unhandled trigger exception by user/organization: 000C0000000xxxx/00x00000000xxxx

 

trgr_PopulateSurveyDateOnContact: execution of AfterUpdate

 

caused by: System.DmlException: Update failed. First exception on row 0 with id 0000000000x0xxxxxx; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, SummarizeContactToolCommerceLogins: execution of AfterUpdate

 

caused by: System.AsyncException: Future method cannot be called from a future or batch method: ContactToolCommerceLogins.SetContactToolCommerceLogins(SET<Id>)

 

Trigger.SummarizeContactLogins: line 41, column 1: []

 

Trigger.trgr_PopulateSurveyDateOnContact: line 15, column 1

 

I read a little about it and am thinking there is some conflict about the trigger having to look at the same record over and over again. I am NOT a developer by any stretch of the imagination. So even the little bit of help I saw in teh Community in other discussions is not helping me. I need someone (Please) to explain to me in layman's terms.

 

I know it is alot to ask, but I am desperate!

 

Thanks so much,

 

Shannon

Dhaval PanchalDhaval Panchal
Please share your code.
Shannon.ax1730Shannon.ax1730

Here are the triggers that are referenced. What else do you need to see?

 

1 trigger trgr_PopulateSurveyDateOnContact on Case (after insert, after update) {

2   List<Contact> contactsToUpdate = new List<Contact>();

3   for(Case cs : trigger.new){

4   if(cs.Last_Survey_Sent_Date__c != NULL && cs.ContactId != NULL){

5        contactsToUpdate.add(

6            new Contact(

7                Id = cs.ContactId,

8                Last_Survey_Sent_Date__c = cs.Last_Survey_Sent_Date__c

9            )

10        );

11  }

12}

13

14 UPDATE contactsToUpdate;

 

1 trigger SummarizeContactLogins on Contact (after insert, after update, after delete) {

2  SET<Id> lstAccountId = new SET<Id>();

3 if(Trigger.isInsert){

4 for(Contact contact : Trigger.New){

5   if(contact.AccountId != null){

6     lstAccountId.add(contact.AccountId);

7   }

8  }

9 }

10 else if(Trigger.isUpdate){

11 for(Contact contact : Trigger.Old){

12 if(contact.AccountId != null){

 13   lstAccountId.add(contact.AccountId);

 14  }

 15 }

 16 for(Contact contact : Trigger.New){

 17 if(contact.AccountId != null){

 18 lstAccountId.add(contact.AccountId);

 19    }

 20   }

 21 }

 22 else if(Trigger.isDelete){

 23 for(Contact contact : Trigger.Old){

   24 if(contact.AccountId != null){

   25    stAccountId.add(contact.AccountId);

   26  }

   27 }

  28 }

  29

  30 // update accounts

  31 if(lstAccountId.size() > 0){

  32 ContactLogins.SetContactLogins(lstAccountId);

  33  }

  34 }

 

 

testrest97testrest97

can you share the future class also