Loading

Unable to create, edit, or delete Apex triggers or classes in Salesforce

Date de publication: Jun 25, 2026
Description

In Salesforce, only Developer Edition, Sandbox, and Trial organizations allow you to create, edit, or delete Apex classes and triggers directly in the Salesforce user interface. Enterprise Edition and Unlimited Edition production organizations can execute Apex and view Apex code in the UI, but cannot modify it directly through the interface. To deploy new or updated Apex to a production org, you must develop and test the code in a Developer Edition, Sandbox, or Trial org first, then deploy it using a supported deployment method.

Résolution

Why You Cannot Edit Apex in Production

Enterprise Edition and Unlimited Edition production orgs restrict direct Apex editing in the UI to protect production environments from untested code changes. Apex modifications must be developed in a non-production environment (Developer Edition, Sandbox, or Trial org) with appropriate test coverage — at least 1% for triggers and 75% for classes — before being deployed to production. A user with the Author Apex permission must perform the deployment.

Supported Apex Deployment Methods

You can deploy Apex from a Developer Edition or Sandbox org to a production org using any of the following methods:

  • Change Sets — available directly in the Salesforce Setup UI
  • Salesforce Extensions for Visual Studio Code — the recommended IDE-based deployment tool
  • Ant Migration Tool — command-line deployment using Apache Ant
  • SOAP API — programmatic deployment via the compileAndTest() or deploy() Metadata API methods
  • Third-party tools that use Metadata API or Tooling API
  • VS Code with Salesforce DX plug-ins

 

     

     

     

    Numéro d’article de la base de connaissances

    000385067

     
    Chargement
    Salesforce Help | Article