i have a code for trigger:

trigger SendDisbursement on Opportunity (after update) {
if (!System.isFuture()){
    for (Integer i = 0; i < Trigger.new.size(); i++) {
        if (Trigger.old[i].StageName != Trigger.new[i].StageName && Trigger.new[i].StageName == 'Disbursement' && Trigger.new[i].RecordTypeId == '12903903930390') {
            Organization org = [SELECT IsSandbox FROM Organization];
            String orgStr = (org.IsSandbox == true) ? 'sale' : 'credit';
            EmailUtil.mailSender(Trigger.new[i], orgStr);

when i try deploy on production i get the message:

Your code coverage is 0%. You need at least 75% coverage to complete this deployment. enter image description here

  • Does this answer your question? How do I write an Apex unit test? Commented Jan 16, 2020 at 3:04
  • Did you deploy your test class as well in the change set? It says only deploying 1 component. If you're deploying this for the first time to production, you'll need to include the trigger and the unit test class Commented Jan 16, 2020 at 7:59

2 Answers 2


To deploy a trigger to production , you will need to ensure your trigger has a test class and the class needs to cover at least 75% of the lines of code .

Looks like you are writing the trigger for first time .

I suggest you go through Salesforce trailhead content and learn some of the best practices such as below

  1. bulkify your trigger

  2. do not write soql or dml inside loop

  3. Have a trigger framework for the project to manage complexity and help easy debugging
  4. Ensure proper test code coverage with system asserts

Check the below link on how to write test case for a trigger


  • Hello, when i upload without check "isActive" work fine deployment, but when i check the "isActive" get a error on deploy, is for any reason?
    – pedroooo
    Commented Jan 16, 2020 at 0:45
  • Have you written the test class ? You will need a test class as well to deploy with the trigger Commented Jan 16, 2020 at 1:33
  • i update the question with the apex class code when i try run the code i get a: "Methods defined as TestMethod do not support Web service callouts"
    – pedroooo
    Commented Jan 16, 2020 at 4:11
  • Looks like you have a third party web service callout using http class.I suggest look into Salesforce mocks for same . Commented Jan 16, 2020 at 12:41

From your last updated comment it seems that you have run the test method but your hackClipDisburse() which is called is not having isTest qualifier I only see one on class.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .