Ajit Naykinde

What happens if two components on the same page import the same Custom Permission, but one is deleted from the org

Solution: If a custom permission is deleted from your Salesforce org, any Apex, Lightning Web Component, or Aura Component code that references it will immediately become invalid.

The Salesforce platform's compiler will prevent you from saving or deploying code that references a nonexistent custom permission. Therefore, the first line of defense is that the code fails to deploy.

However, if the code was already deployed and the custom permission was later deleted (which is a less common scenario, often due to a destructive change or a managed package uninstallation), both components on the page would fail at runtime. The system would be unable to resolve the permission reference, resulting in an unhandled exception or a component error on the page.

2 months ago | [YT] | 0