if you want to consider the createdate, so you delete all the data not created this year: - open the Developer Console and go to execute anonymous and write the following code:
delete [select id from object where createddate != this_year];
If you want to delete the records not last modifed this year:
delete [select id from object where lastmodifieddate != this_year];
If you want to delete all the records not modified this year and not created this year:
delete [select id from object where lastmodifieddate != this_year and createddate!= this_year];
Kindly mark as best answer if this solves your question
- open the Developer Console and go to execute anonymous and write the following code: If you want to delete the records not last modifed this year:
If you want to delete all the records not modified this year and not created this year:
Kindly mark as best answer if this solves your question