function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
asadim2asadim2 

Can Tooling API create Apex content in Production Orgs?

You know how you need to use Changesets to deploy stuff from sandbox to production? So am I going to run into errors if my code tries to create Apex classes and VF pages in a production org?

Thanks.
Best Answer chosen by asadim2
Vinita_SFDCVinita_SFDC
Hi,

How will you create an Apex class in production with Tooling API? create() is used to compile Apex classes or triggers in Developer Edition or sandbox organizations.

You can't create or develop classes directly in a production org using any tool.

All Answers

Vinita_SFDCVinita_SFDC
Hi,

You can not create/write apex code in production. You can do that in sandbox and once test coverage is above 75%, deploy it in production.
asadim2asadim2
What if I include all test cases in my Apex class? What about VF pages?

Please note that I'm using the Tooling API. Otherwise as I already mentioned I am well aware of code deployment requirements.
Vinita_SFDCVinita_SFDC
Hi,

How will you create an Apex class in production with Tooling API? create() is used to compile Apex classes or triggers in Developer Edition or sandbox organizations.

You can't create or develop classes directly in a production org using any tool.
This was selected as the best answer
asadim2asadim2
So from the sounds of it I can create VF pages in production with the Tooling API. Am I right?
Vinita_SFDCVinita_SFDC
Hi,

Visualforce pages can be created and edited in sandbox and in production. If it involves a custom controller or extension (apex classed) then you will have to develop that in sandbox.
asadim2asadim2
Thanks Vinita.