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
Andrew EAndrew E 

Is there a way to get a stacktrace without an exception?

Hello all,

I currently have a function (let's call it function doSave()) executing without being called. It is only referenced twice and I have a System.debug in both functions that call doSave(), but none of them output the System Debug line so I'm pretty certain they are not calling it.

I'm pretty bamboozled. I'd like to add a System.debug line to my doSave() function that would print the stacktrace so I can see what function is calling it or why it is running. Is this possible?
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Andrew,

Please check the below link from success community on Stack Trace with Exceptions.
https://success.salesforce.com/ideaView?id=08730000000BqLN

Hope it will be helpful.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar