We have some custom code from before I joined the company that is showing some unusual behavior.
- Code was somehow successfully deployed to production (before my time), and the test code passes within production currently.
- Code also passes in all existing unrefreshed sandboxes, but fails on deployment
- When I create a new sandbox off of production, the test passes successfully in that new sandbox.
- But when I attempt to deploy that same code from the new sandbox to production, the test fails!
I'm aware of 4 possible causes of such mysterious deployment failures:
- Differences in metadata like validation rules and workflows
System.RunAs()statements coupled with differences in profiles/permissions
SeeAllData=Trueand using data that doesn't exist in both orgs
- Using hardcoded IDs
However, none of those should apply in my situation:
- No differences in metadata (sandbox was refreshed recently)
- There is a
System.RunAs()statement used, but there wouldn't be any differences in profile perms because, again, the sandbox was refreshed recently.
- There are no hardcoded IDs nor is
seeAllData=Trueset in this code
Can anyone offer any insight before I enter another epic struggle with SF tech support?