You need to sign in to do that
Don't have an account?

Code Coverage for Trigger is being evaluated as a class and not as a trigger.
Hello,
I currently having and issue with trying to deploy a fix to a trigger class that we have. When I validate it, I receive the following error:
Your code coverage is 8%. You need at least 75% coverage to complete this deployment.
The issue is that, this isnt a regular apex class, it is a trigger. From what I understand, triggers need to have >0% code coverage, which I have 8% code coverage. Any ideas as to why this is being evaluated at the 75% code coverage and not at the >0% code coverage.
I currently having and issue with trying to deploy a fix to a trigger class that we have. When I validate it, I receive the following error:
Your code coverage is 8%. You need at least 75% coverage to complete this deployment.
The issue is that, this isnt a regular apex class, it is a trigger. From what I understand, triggers need to have >0% code coverage, which I have 8% code coverage. Any ideas as to why this is being evaluated at the 75% code coverage and not at the >0% code coverage.
Even though an individual, particular trigger doesn't need more than 1% coverage, you still must have 75% complete code coverage for the entirety of the Org in order to deploy any apex.
Best practice is to treat your trigger as though it is an Apex class and keep its code coverage above 75% individually, and strive for 100% coverage.
Hope that helps!
All Answers
Even though an individual, particular trigger doesn't need more than 1% coverage, you still must have 75% complete code coverage for the entirety of the Org in order to deploy any apex.
Best practice is to treat your trigger as though it is an Apex class and keep its code coverage above 75% individually, and strive for 100% coverage.
Hope that helps!