You need to sign in to do that
Don't have an account?
Francisco Riccomagno 1
How to delete ApexTestResult records
Hello, I have an org where we have more than 14000 test methods and we ran the whole suite of tests daily. As you can imagine the ApexTestResult grows very fast. I have been going and manually deleting those records through the UI in a weekly basis, but would like to know if there is a way to create a schedule job that does this. I tried to delete this through the exceute anonymous by doing
Is there a way to achieve this programatically?
Thank you.
List<ApexTestResult> apexTestResultList = [SELECT Id FROM ApexTestResult]; system.debug('apexTestResultList found: ' + apexTestResultList.size()); delete apexTestResultList;But I get an error that says "Delete not allowed on List<ApexTestResult>"
Is there a way to achieve this programatically?
Thank you.
https://developer.salesforce.com/docs/api-explorer/sobject/ApexTestResult/delete-apextestresult-id
Option 2 : Setup --> Apex Test Execution--> View Test History -->Clcik on Clear test data button