We have a sandbox that is partial. It would appear that the refresh did not bring down everything it was supposed to in order for the instance to work properly.
I'm currently working on a batchClass that will update old Opportunities to
Closed Lost, but when doing some tests on sample records, Salesforce will fail with an internal server error.
I'm not sure what the best practice approach would be to continue validating my app, but have come up with these 3 options:
Create a Formula Field that is CreatedDate - 7 and run my tests off that to validate that the records are updating correctly in the UI. Then when I write test classes and methods change the query to use CreatedDate and use Test.SetCreatedDate Method that was implemented in 16' releases.
Just write the test classes and if they pass, then we should be good to go.
Apparently you could import data in via the dataLoader and get the CreatedDate set that way if the Audit Fields setting is activated.
Am I missing an option? Is 2 the best approach?