I'm looking for a way to get the name of an object instance at run-time. Is it possible to to determine the class name (as a string) of an instance? i.e. is there an Apex equivalent of the Java myInstance.getClass().getName() or any tricks to achieve just that?
Tell me more
×
Salesforce Stack Exchange is a question and answer site for
Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.
|
|
|||||
|
System.debug(String.valueOf(new MyClass()));//MyClass:[]System.debug(String.valueOf(new PageReference('')));//System.PageReference[]– user320 Jan 16 at 16:36