• Bas Brussel
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi Members I have a after update trigger that calls a class method.
But the update fails with the error: Apex trigger caused an unexpected exception:ANNOT_INSERT_UPDATE_ACTIVATE_ENTITY.

Here is is the code, the error is ocated at line code: "Update gloOppty;"
trigger TotalAmountGlobalOpportunity on Opportunity (after insert, after update, after undelete) {
Opportunity[] Opptys = Trigger.new;
    
   id GlobalOp = 'xxxx00000H1XuHQAV';
   Opportunity gloOppty = [select id, amount, StageName from opportunity where id =:GlobalOp];
   gloOppty.StageName = 'Closed Won'; 
    //System.debug(gloOppty);
   Update gloOppty;  
   
}

Can anyone suggest ?

Br,
Bas
Hi Members I have a after update trigger that calls a class method.
But the update fails with the error: Apex trigger caused an unexpected exception:ANNOT_INSERT_UPDATE_ACTIVATE_ENTITY.

Here is is the code, the error is ocated at line code: "Update gloOppty;"
trigger TotalAmountGlobalOpportunity on Opportunity (after insert, after update, after undelete) {
Opportunity[] Opptys = Trigger.new;
    
   id GlobalOp = 'xxxx00000H1XuHQAV';
   Opportunity gloOppty = [select id, amount, StageName from opportunity where id =:GlobalOp];
   gloOppty.StageName = 'Closed Won'; 
    //System.debug(gloOppty);
   Update gloOppty;  
   
}

Can anyone suggest ?

Br,
Bas