1

Coud you please suggest appropriate solution to the following error.

Error: Apex trigger PreventTaskOwnerChangeTrigger caused an unexpected exception, contact your administrator: PreventTaskOwnerChangeTrigger: data changed by trigger for field Account: id value of incorrect type: 0051400000BOJxdAAH

1
  • 4
    Can you post the code of your trigger too ?
    – SF_user
    Commented May 28, 2015 at 14:27

1 Answer 1

6

Its tough to specify exactly without your code, but from the error, it seems you are trying to set a lookup field that is expecting and Account ID with a user ID.

The 3 digit prefix for the account object is '001', you are trying to set a value that is expecting an account Id with a User Id. You can tell this because the 3 digit prefix for the user object is '005'.

3
  • 1
    Salesforce psychic....Chris is so good that he's fixin triggers without even seeing them ;) Commented May 28, 2015 at 14:44
  • 1
    However, given the name of this trigger, it may be more simply accomplished in a validation rule similar to what is discussed in this thread: salesforce.stackexchange.com/questions/77802/… Commented May 28, 2015 at 14:47
  • +1 @Todd, you are right, it may be we don't need the trigger at all. (Again tough to say without seeing code) I was just trying to shed some light on the error that was being received. Commented May 28, 2015 at 15:43

Not the answer you're looking for? Browse other questions tagged .