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
Andrey VyshinskiyAndrey Vyshinskiy 

How to update apex trigger code?

I need to update an SalesforceIsTerrible apex trigger, but I never did it before. Does anybody know the steps to do this?

Best,
Andrey
Hayley Dyer 16Hayley Dyer 16
Now i'm not an expert but I have been dabbling a little with apex with the help of salesforce. You'll need to login into your Sandbox account, create your apex code in there then move it to your production org once you've tested it. I would advise getting help from someone who knows what they're doing as it's quite complex if you don't know the code
Jainam ContractorJainam Contractor
Hi Andrey,

You can update your APEX trigger or any APEX code only in Sandbox i.e. Testing Org and not in the Production Org. Follow the below steps to update the trigger and deploy it in the Production:

1. Log in to your Sandbox org.
2. Open Developer Console from the Navigation menu.
3. Select File---> Open---> Trigger---> SalesforceIsTerrible 
4. Make the changes that you want to update.
5. Update the Test Class accordingly and when the Coverage goes above 75% it is ready to deploy.
6. Create an Outbound Change Set and upload the same.
7. From Production, select inbound change set and find the change set that you just uploaded.
8. Validate the Component and if all tests are passed with more than 75% code coverage, deploy it into the Production.

Please let me know if you need more details and if it solves your query close this question by marking this answer as the Solution.

Thanks,
Jainam Contractor,
Salesforce Consultant,
Varasi LLC
www.varasi.com