-5

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception_methods.htm#exception_common_methods This site shows that getLineNumber was included, but I am not able to use it. Thanks

( I am trying to locate a Null Pointer Exception )

René Link
  • 48,224
  • 13
  • 108
  • 140

2 Answers2

5

a NullPointerException stack trace includes a line number, so the exception should print it.

Ross Drew
  • 8,163
  • 2
  • 41
  • 53
0

It's unclear what you're asking, please show some code.

getLineNumber() and getStackTraceString() should include the line number (among others). Check https://developer.salesforce.com/forums?id=906F00000008xc4IAA for sample message.

As for "how to print" - there's a try-catch example. Either simply push it at System.debug() or (if it's visualforce context) you can add a pagemessage.

You can also go to setup -> debug log, attach the tracking to your user and retry the action? You'll see the stacktrace and other goodies, line numbers next to the names of called methods...

eyescream
  • 18,088
  • 2
  • 34
  • 46