Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type.forName not namespace safe #152

Open
yippie opened this issue Jul 9, 2024 · 1 comment
Open

Type.forName not namespace safe #152

yippie opened this issue Jul 9, 2024 · 1 comment

Comments

@yippie
Copy link

yippie commented Jul 9, 2024

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
Copy link
Author

yippie commented Jul 9, 2024

Fixed by #149

@yippie yippie mentioned this issue Jul 9, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant