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

Get Stack Trace without an Exception

Does anyone know if there is a way to get the stack trace from APEX without generating an Exception  to slow things down?  I have something that might be called in a Loop and want to know precisely where it came from without having to generate a false exception.  Thanx!
Maybe you can add some debug logs to your Apex code and turn on "Debug Logs" to check the details.
Yes, but I need to actually record where it’s coming from. Thanx though!
Tom Gagne 39Tom Gagne 39
Just new-up a new exception and get the stacktrace.  No need to "throw" or "catch" it.