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
Ahmad HelalAhmad Helal 

"Every trigger must have some test coverage" Error

I followed the instructions here: http://rjpalombo.com/2013/11/counting-open-activities-salesforce/

That code works perfectly in my sandbox org and does what it needs. When I try to deploy to production I get the following error:

the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage. OpportunityProductTrigger

The odd thing is that Trigger it refers to in the error  (OpportunityProduct Trigger) shows 100% code coverage and has long existed in the production org. The trigger was created by 1 of our contracted developers. I'm not a developer myself but understand all the basic concepts and slowly trying to learn.  
nbansal10nbansal10
Go to Developer Console and check from which class this trigger is getting covered. 
Alternative is to write a new test class for this trigger if none exists. Test class for triggers is pretty simple. Inserting/Updating a record in test class will do the bit.
sandeep sankhlasandeep sankhla
Hi Ahmad,

Please paste your class code if you are getting any diffculity in writting the test code here..I will help you to write the test code for your class..

Thanks,
Sandeep 
Ash Jones 10Ash Jones 10
Hi Sandeep,
Can you help me with the above mentioned issue? I am facing the same problem and need help writing the apex class code.