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
Marina TrosMarina Tros 

get calling source of trigger

Hi, 
I have a managed package with different triggers. 
Is there a way to get the calling source that invoked the trigeer action? for example if other package initiated the action - get its namespace,
also if it's from other context like an action from email etc...
I need to get as much information as possible regarding the action's source.

Thanks.


 
NagendraNagendra (Salesforce Developers) 
Hi Marina,

It seems that you want to monitor the usage of some specific org resources, like when a user visits and interacts with a Visualforce page or component, and it calls Apex, etc.

You might be out of luck if you want to know if the user called an action with a button or a trigger, because it will show on the event log that the user "called this code at this time", not necessarily it will display if they clicked something.

My suggestion is to take a look at the EventLogFile object and the trail about it on Trailhead. It should contain more information than you need to, but at least is something you can query and throw at some spreadsheet software instead of writing Apex code.

Thanks,
Nagendra