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
TheReportDoctorTheReportDoctor 

Trigger Tracking

Is there a way to track what fired a trigger.  Example:  Was the trigger caused by the user updating the data, was the trigger caused by another trigger updating the data, or was the trigger caused by a batch process?
gv007gv007
Track using debug log , punting some system.debug comments.
TheReportDoctorTheReportDoctor
Do what?  I need a property on the Trigger object that tells me who caused the trigger to run.  Nothing here about debugging.
gv007gv007
You need to implement the logic in the trigger. Like some field updated happened then ask the trigger to do some actions.
TheReportDoctorTheReportDoctor

Let's see.....

 

What field do I update when the user has updated the record in the salesforce.com interface?

 

What field do I update when a trigger has updated the record?

 

What field do I update when a batch job has updated the record?

 

Oh, by the way,  how do I know that a user has updated a record, how do I know that a trigger has updated the record, and how do I know a batch job has updated the record?  If I know this I don't need to update a record!

 

 

I AM LOOKING FOR A PROPERTY ON THE TRIGGER OBJECT SO I CAN ASK WHO TRIGGERED THE TRIGGER!