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
CushtyCushty 

amend a class in production

 Hi,

I am relavively new to apex and triggers and this may sound a silly question.  How do I now make amendments to an existing class i have already deployed in production?
Do I amend it in sandbox and deploy the same class in a change set and it overrides the existing one?

Thanks
Best Answer chosen by Cushty
Medhya MahajanMedhya Mahajan
Hi Cushty, 

If you are a system admin you can make the amends directly even. 

However, it is always advisable to make changes in the code in sandbox, test your functionality thoroughly and Run Local or Run All tests and deploy your code to production to ensure it does not affect the existing code in your production.

Once you re deploy, the classes in production will be over written with new changes.

Mark solved if it helped.

Regards
Medhya Mahajan

All Answers

Medhya MahajanMedhya Mahajan
Hi Cushty, 

If you are a system admin you can make the amends directly even. 

However, it is always advisable to make changes in the code in sandbox, test your functionality thoroughly and Run Local or Run All tests and deploy your code to production to ensure it does not affect the existing code in your production.

Once you re deploy, the classes in production will be over written with new changes.

Mark solved if it helped.

Regards
Medhya Mahajan
This was selected as the best answer
Harish RamachandruniHarish Ramachandruni
​ Hi,


What you want changes in production you can't change anything . What you want to change create same class trigger or vf page name same and deploy to production it will over ride .i am shore on that .



Regards,
​harish.R
 
Medhya MahajanMedhya Mahajan
@Cushty, 

Sorry a correction here : you cannot directly change code in Production, salesforce does not allow that. 
You don't get to see the edit button your classes or trigger.

Regards
Medhya Mahajan