You need to sign in to do that
Don't have an account?

How to use Id in apex that needs tested before deployed?
I have a user who imports data in our production instance, and I wrote a scheduled apex to process that data. The most sure way to query the records to process is to use the user's LastModifiedById. However, I have to write and test the code in our sandbox, and test 75%+ to deploy to production. The user's production Id isn't recognized in sandbox, so no records are found and not enough of the code gets tested. How would you work around this?
Then, the testing code can run in both Sandbox and Production without any modification?
If so, here is one. Please have fun with it.