1

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:

enter image description here

Grzegorz Połuch
  • 699
  • 9
  • 32

1 Answers1

2

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'; }
}
Adrian Larson
  • 149,971
  • 38
  • 239
  • 420