I am experimenting with tooling api and it is possible to create apex classes, triggers using tooling api.

As name "tooling" suggests that it is used for developing IDEs. I was wondering can we deploy code using tooling api in production.

I could have checked by running the same code on production. But I don't want to experiment with production.

If anyone has any experience then please share.

1 Answer 1


No you cannot create classes and triggers in Production.I have seen apps where people have written tooling API code to dynamically build visualforce tags or show test coverage graphs but not apex triggers and apex classes.

Salesforce does not allow writing classes or triggers in PROD directly .It has to be deployed from sandbox or IDE using Metadata API .

  • Is there any other REST based approach for deploying ApexClass,Triggers,Components and VF pages? Commented Jan 15, 2016 at 11:39
  • No..For PROD you can use metadata API only to deploy code. Commented Jan 15, 2016 at 13:00
  • You can use the Metadata API to create Apex Classes and Apex Triggers in Production. Andrew Fawcett has shared an example.
    – Jochen
    Commented Nov 3, 2016 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .