{kb-symptom}
The first time you run Task History Cleanup, it may fail with these error messages:
{code}Could not remove TaskSchedule object for task{code}
and
{code}violation of foreign key constraint{code}
{kb-resolution}
Workaround:
Re-run Task History Cleanup after the first failed attempt in order to remove the remaining tasks that were not deleted on the first attempt.
{kb-related-articles}
The first time you run Task History Cleanup, it may fail with these error messages:
{code}Could not remove TaskSchedule object for task{code}
and
{code}violation of foreign key constraint{code}
{kb-resolution}
Workaround:
Re-run Task History Cleanup after the first failed attempt in order to remove the remaining tasks that were not deleted on the first attempt.
{kb-related-articles}