Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Cognizant
IN
Last activity: 1 Apr 2024 15:32 EDT
How to Archive all the Pega cases which got resolved 2days before the current date time.
How can we archive all those cases from pega which got resolved before 2 days of the create date time.How to configure a utility for this and also is there any OOTB configuration provided by pega for archival?
***Edited by Moderator Rupashree S. to add Capability tags***
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 1 Apr 2024 15:30 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
Maantic Inc
IN
Pega Cloud provides an OOTB functionality for auto archival. Goto the Case Type>Settings>Archival then check Enable archival checkbox and provide the number of days to consider that are resolved earlier than. You can get more details about the process here:
https://docs-previous.pega.com/system-administration/86/case-archiving-and-purging-overview?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Cognizant
IN
@SohamM95 could also provide the other configuration that is via utility.Like i just know the basics that an activity needs to run but in order to do so what are the process that we need to follow.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
Maantic Inc
IN
It is no longer recommended to setup the archival process manually. Pega used to have an archival utility before which they stopped supporting. You can get more details here:
https://community.pega.com/video-library/pega-7-data-archival-utility-demo
Since in the OOTB process, Pega runs a lot of jobs and a lot of tables are utilized to maintain data integrity, it better to follow the OOTB wizard. You can still go through the process in the following link and try to replicate the logic in your own way:
https://docs-previous.pega.com/system-administration/87/case-archiving-process
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Cognizant
IN
@SohamM95 actually my lead wants both the approach one via OOTB configuration that you already have provided and other via a utility.
So coming to this utility I am using a job scheduler and then created an activity inside it and that activity I am calling a RD to fetch the list of Resolved cases before 2 days of the current date time but in that logic itself I am confused that how to delete the instances.
Please find the screenshot attached:
Updated: 1 Apr 2024 15:30 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
Maantic Inc
IN
Logically your activity should work, keep in the mind the page references. But here once you delete you wont be able to retrieve the data anytime in future. Also delete-by-handle is an expensive function, for each record its going to hit the database which is not recommended. Try to run the delete in a queue processor or while looping set pyIsRecordDeleted to true, then run a job later when there is low number of users in the system and remove those records.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Cognizant
IN
@SohamM95 even if we try to delete in a queue then what will be the logic for this as calling the RD and queue processor in job scheduler’s activity then writing a separate activity for queue processor but how to delete then?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689970000/7e3f37e0-829b-49b9-a546-e4e44499aaab.png?itok=9L11iBX5)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689970000/7e3f37e0-829b-49b9-a546-e4e44499aaab.png?itok=9L11iBX5)
Pegasystems Inc.
US
@SohamM95 and @TanyaS58 , OOTB Case Archival is the correct way, if you want to set up archiving on an on-going basis. It not only deletes the case, but it's children and associated data like history, pulse, attachments, etc.