You need to sign in to do that
Don't have an account?
Patrick Conner
Purge all objects not matching criteria
Hey!
I'd like to purge all objects not matching certain field values.
Is it possible to create a batch class removing all tasks older than a certain date, except the task with an ID matching an Account field "Task ID"? This would leave 1 task with ID = Account.TaskID.
Thanks for any help!
I'd like to purge all objects not matching certain field values.
Is it possible to create a batch class removing all tasks older than a certain date, except the task with an ID matching an Account field "Task ID"? This would leave 1 task with ID = Account.TaskID.
Thanks for any help!
All Answers
Not 100% clear what you want to do. But if you can write SOQL to retrieve the tasks to delete then batch apex might work.
Is the field Account.TaskID a custom field on the Account object? You may want to retrieve all the TaskID values from Accounts and store in a collection object (Sets work well) and then query Tasks based on the date and ID not in the Set.
Debra