You need to sign in to do that
Don't have an account?
How to get name of the class from its instance
Hi All,
I've situation where I need to get the name of the Apex class from its instance.
The declared instance variable is of very generic type (Object) and using this variable, I need the name of the specific class from which the object was instantiated.
Because of my requirements I cant use instanceof here, and I dont want to resort to "String.valueOf(obj)" as this is not the reliable way.
Please assist.
I've situation where I need to get the name of the Apex class from its instance.
The declared instance variable is of very generic type (Object) and using this variable, I need the name of the specific class from which the object was instantiated.
Because of my requirements I cant use instanceof here, and I dont want to resort to "String.valueOf(obj)" as this is not the reliable way.
Please assist.
For the sake of confidentiality I cant post the code here, but yes this is the concept.
Thanks.