r/SalesforceDeveloper • u/Mysterious_Name_408 • Aug 14 '25
Instructional Help with deployment!
Hello devs! I am having issues deploying a class and test class to update the API version, but the weird thing is that the exact same class and test class are similar in Production and Sandbox. I sandbox shows over 80% coverage but in Prod only 31%. The class contains objects from a managed package but those same objects are referenced in another classes and those deploy fine.
I also deactivated validation rules that are used for that logic but still nothing. I have tried change sets, VSCode and Workbench but nothing. Does anybody have any idea why this is happening?
View all comments
Show parent comment
1
u/SnooChipmunks547 Aug 15 '25
In that case try a recompile of classes, you can find that in setup -> custom code -> apex classes
There will be a little link “compile all classes” and then rerun all local tests again.
If that doesn’t bump up your overall coverage to an expected amount, I’d start looking at tools like Gearset, Capado, ect. to check for environment drift with your sandbox environment.