mitchspano/trigger-actions-framework

Type.forName not namespace safe

Opened this issue · 1 comments

yippie commented

If packaged, Actions and Finalizers use an API that cannot access classes outside of the same package. Salesforce Documentation on the Type.forName warns of this and suggests using an alternative API https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_type.htm#apex_System_Type_forName

This adds new Apex_Class_Namespace fields and uses the more explicit and safer version of Type.ForName. I also included a fallback to make sure no existing functionality is lost.

Expected Behavior

Custom action to run

Actual Behavior

Non-namespaced action classes will not be found or used

Steps to Reproduce the Problem

  1. Package apex-trigger-action-framework in a Namespaced package.
  2. Create a Trigger action handler that is not namespaced
  3. Create a trigger action for the handler
  4. Do DML to cause the action to happen
yippie commented

Fixed by #149