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
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior 

Does anyone can confirm if it is possible to create a trigger for "__History" objects?

Hello folks,

First of all, I'm a newbie on SalesForce, so accept my apologies if my question sounds dumb.

I have to create a trigger that creates a task after an e-mail is sent from Activity History in a custom object. I am trying to use MyCustomObject__History but I'm getting the following error: SObject type does not allow triggers: MyCustomObject__History.

Does anyone can confirm if it is possible to create a trigger for "__History" objects?

Many thanks in advance.
Best Answer chosen by Zuinglio Lopes Ribeiro Júnior
SamuelDeRyckeSamuelDeRycke
No you can't, the x__history objects are the field history tracking objects. But you can write triggers on the Activity object, which I think you're looking for.

All Answers

SamuelDeRyckeSamuelDeRycke
No you can't, the x__history objects are the field history tracking objects. But you can write triggers on the Activity object, which I think you're looking for.
This was selected as the best answer
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
That was a hot tip! Thanks!