I would like to get Apex class name without namespace prefix. I wonder if exists any equivalent method like known in Java getSimpleName() ?
Existing method getName() returns apex class name with namespace like follows:
I would like to get Apex class name without namespace prefix. I wonder if exists any equivalent method like known in Java getSimpleName() ?
Existing method getName() returns apex class name with namespace like follows:
No such reflection is available in Apex. If you want to know they type name, you will have to implement it manually.
public class MyType
{
public String getTypeName() { return 'MyType'; }
}
MyApexClass.class.getName()which in fact returns apex class name, but with namespace prefix. – Grzegorz Połuch Jul 05 '18 at 20:36