Skip to content

Type.forName not namespace safe #152

@yippie

Description

@yippie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions