• Anna Signor
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have am writing a trigger on Account that is supposed to fire when the Account Owner is changed. I tested the logic using classes and everything is doing its job, except the trigger is simply not firing. I then changed it to be triggered by different fields and it works just fine in those cases. I read something about Account Change Owner wizard operations not initiating process flows, is that true for triggers as well? What are my alternatives here?
Not firing:
trigger AccountTrigger on Account (after update) {
    System.debug('Account Team Trigger fired');
    for(Id acctId: Trigger.newMap.keySet()){
       if(Trigger.oldMap.get(acctId).OwnerId!= Trigger.newMap.get(acctId).OwnerId){
       classes.dostuff();     
  }
}
DML;
}
However, this one is firing, only when I edit from the edit page, which is not possible for Account Owner:
trigger AccountTrigger on Account (after update) {
    System.debug('Account Team Trigger fired');
    for(Id acctId: Trigger.newMap.keySet()){
       if(Trigger.oldMap.get(acctId).otherField__c!= Trigger.newMap.get(acctId).otherField__c){
       classes.dostuff();     
  }
}
DML;
}


 
I have am writing a trigger on Account that is supposed to fire when the Account Owner is changed. I tested the logic using classes and everything is doing its job, except the trigger is simply not firing. I then changed it to be triggered by different fields and it works just fine in those cases. I read something about Account Change Owner wizard operations not initiating process flows, is that true for triggers as well? What are my alternatives here?
Not firing:
trigger AccountTrigger on Account (after update) {
    System.debug('Account Team Trigger fired');
    for(Id acctId: Trigger.newMap.keySet()){
       if(Trigger.oldMap.get(acctId).OwnerId!= Trigger.newMap.get(acctId).OwnerId){
       classes.dostuff();     
  }
}
DML;
}
However, this one is firing, only when I edit from the edit page, which is not possible for Account Owner:
trigger AccountTrigger on Account (after update) {
    System.debug('Account Team Trigger fired');
    for(Id acctId: Trigger.newMap.keySet()){
       if(Trigger.oldMap.get(acctId).otherField__c!= Trigger.newMap.get(acctId).otherField__c){
       classes.dostuff();     
  }
}
DML;
}