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
OneNewbieOneNewbie 

Triggers issue during deployment

I created my first trigger and test class in my developer's account. I got the coverage and no issues when testing. I decided to deploy the trigger to our sandbox so some of our users can test it out before we push it out to production. When I do the 'deploy to server' from my developer account, everything goes fine. Trigger and test class is pushed into sandbox. However, if I run the test in Sandbox with the test class I pushed from my developer account I get an assert which I didn't get on my developer account. Any ideas why it would work on my Developer account but not in Sanbox?

Thanks
Ron HessRon Hess
This can happen if your test method uses data that exists in your developer org and does not exist in sandbox

normal testmethod will construct any and all data that it uses to ensure that the exact same data is present whenever the test is run