You need to sign in to do that
Don't have an account?

Getting current class/method name
Hello,
I'm developing error logger for SFDC and im courius is there a way to get current class and method name?
E.g. i want to add in catch exception brackets line:
logNewError(currentClassName, currentMethodName, errorDescription).
I hope you got my point;)
Best Regards,
Lukas
The Exception class includes the method and class that caused the error.
Error: Invalid Data. Review all error messages below to correct your data. Apex trigger AccountTrigger caused an unexpected exception, contact your administrator: AccountTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0a30000000t0OmAAI; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ServiceEntitlementRYG: execution of AfterUpdate caused by: System.ListException: Duplicate id in list: 0013000000M2efHAAR Class.trafficLightUtils.updateServiceEntitlement: line 27, column 13 Trigger.ServiceEntitlementRYG: line 17, column 7: Class.SyncAccountMemberOwner.updateServiceEntitlements: line 59, column 3
Hi,
I need to retrieve the current class name and current method name within catch block to log the exception..Could u plz tell me which method of exception class should i use to get this..
Thanks in advance,
Suvra
Hi,
Did you figure out how to do this? I am looking at doing the samething.
This works where the value of "this" is the class (or the code is contained by a class).