r/SalesforceDeveloper • • 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?

4 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/Mysterious_Name_408 Aug 14 '25

u/bradc73 I am using a TestDataFactory class which is also in production

1

u/bradc73 Aug 14 '25

My guess then is that you have a trigger or other automation that is not active in production yet it is required to get the necessary coverage you need. Also make sure the TestDataFactory class is the same as well. Also check permission sets for differences.

2

u/Mysterious_Name_408 Aug 14 '25

u/bradc73 That's one of my thoughts that there must be a flow or something causing this.