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
Andreas WissmeyerAndreas Wissmeyer 

Is there a quick way to load an apex class to a production environment?

Hello all,
I work in a 10-people company, I did a small Lightining app in order to make our everyday Salesforce life better. I developed it in the sandbox, an it works just fine. Now I would like to load it in the production environment (Salesforce).
Components:

Lightning app ==> BASED ON ==> Visualforce Page ==> CALLING A ==> Custom controller (Apex Class) ==> UPDATING A ==> New account field

No problem creating the new account field in PROD environment, but apparently I "Can not create Apex Class on an active organization." Is it possible to overcome this? I would like to avoid long procedures..

Thanks in advance for sharing your knowledge on this one.

Cheers,

Andreas

Biswa RayBiswa Ray

Hi Andreas,
 

Salesforce doesn't allow us to directly create any Apex class or trigger in Production due to security concerns. Objects,fields,workflow can be created directly in production. It seems there is no shortcut or alternatives to create apex class in production org directly. 

Steps Should be ,

1) Create and Test Logic in Sandbox.  Already done in your case.
2) Once tested Deploy all the related components (Meta Data) to Production from Sandbox using either any one of the following ways,

  • Change Set (No additional tool or skills required. OOB Inbuilt tool given by Salesforce)  ** Highly Recommended approach to move meta data between connected orgs).
  • Force.com IDE (Requires Eclipse and Force.com plugin to create salesforce project)
  • Ant Migration tool (Requires Ant tool and basic knowledge in XML)

Hope it helps.

Cheers!!
Andreas WissmeyerAndreas Wissmeyer

Hello Biswa,
sorry for replying so late but in fact I solved my problem using a mix from a bunch of answers provided in different threads. Without boring you with all the details, what I did was playing with the "Outbound Change Sets" from my sandbox environment and "Inbound Change Sets" in my Production environment (point one of your intervention). I didn't use Force.com IDE and Ant Migration tool.

To sum up, you pushed me towards the right direction but I went on a different path than the one you suggested me, too complicated if you aren't a pure developer (which is my case).

Thanks a lot anyway for taking the time to answer my question!

Cheers,

Andreas