I am writing a trigger that's supposed to be calculating the NPS Score, but can't even seem to update the Account by writing a value to a field. I keep getting this error:
execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 001f000000BdVpzAAF; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
trigger CalculateNPS on Account (after update) {
List<Account> acc = new List<Account>();
acc = [SELECT Id FROM Account WHERE Id IN: Trigger.oldMap.keySet() LIMIT 1];
for (Account a : acc) {
a.NPS_Score_Trigger__c = 9;
}
update acc;
}