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
Nick ValerioteNick Valeriote 

Need to create unit test for Trigger change set

Hi SF Community,

An ex employee who was code-savvy has left us.  I know how to modify his existing code (for a trigger) in Sandbox to meet some new needs, but I'm not sure how to create a specific unit test to be included in the valadation process of my change set.

Is there a way to bypass running tests on inbound change sets for triggers?  If not, does anyone have an idea how I can create a simple unit test for the trigger I'm looking to push to production?

Thanks!
Nick
Avishek Nanda 14Avishek Nanda 14
Hi Nick,

When deploying the changeset you can select run all local test option Which will run all the test class is there in your production. If your overall production code coverage is more than 75% then you would be able to deploy the trigger without requiring a test class if its something urgent which needs to be deployed. 

However, it is not a best practice. I wouldn't have you to make this a practice.  Let me know if this helps. If not Please help me with the code so that I can help you with the test class. 

Regards,
Avishek Nanda
Nick ValerioteNick Valeriote
Thanks, Avishek!  I managed to get one of our internal developers (not a SF developer) to help me create the unit tests.  I appreciate your time and offer to help.  Cheers. Nick