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
Eli Flores, SFDC DevEli Flores, SFDC Dev 

Change Set Deployment - Tests on other things

I'm trying to deploy a new custom object + and Apex Class + Test Class and a couple triggers. When I run my tests on my sandbox, it tests fine.

 

When I try to deploy it, it fails and says I have too many SOQL statements and throws the error on an unrelated trigger that should never get fired in my tests.

 

How can  I figure out where other stuff is being fired besides my test class?

Jia HuJia Hu
Before you can Deploy, all the tests will run.

In the Inbound Change Sets, click your Change Set Name, then click View Results, you will see where it is getting wrong.
Eli Flores, SFDC DevEli Flores, SFDC Dev

I only get one message though and it's not something that triggered by one of my tests. I need a log of some sort to see how that particular bit is being triggered.

Jia HuJia Hu
Firstly, make sure the error is from your Change Set or from the code in the Production.

Use Develop -> Apex Test Execution to test all the Class in the Production, make sure getting no errors,

Then go back to your Change Set, before Release, click Confirm to test it.
RakeshistomRakeshistom

I had same problem, This is your thinking it's giving error on unrelated trigger but main logic is that when you trying to deploy your changesets it will run all test class so all SOQL query will run and if it ;s finequery more then 100 it will give error on that trigger.

 

So solution is you need to use list or map in your trigger to solve this issue

Eli Flores, SFDC DevEli Flores, SFDC Dev
That wasn't issue as my triggers were properly bulkified. Ulitmately, I was able to solve the issue by deploying item by item from eclipse instead of from a change set.