Changed behaviour on Type.forName

Detect usages of Type.forName()

Gabriele Gallo Stampino avatar
Written by Gabriele Gallo Stampino
Updated over a week ago

Salesforce has changed the behaviour of the Type.forName Method. Using an invalid namespace while calling the Type.forName() method now returns null.

Previously, Apex allowed you to specify an invalid namespace such as Type.forName('InvalidNamespace', 'OuterClass.InnerClass') or use an outer class as a namespace such as Type.forName('OuterClass', 'InnerClass') with indeterminate results.

Additional Resources

Scope

  • Apex

Did this answer your question?