The CreatorCon Call for Content is officially open! Get started here.

Archive Rule

roomawakar
Tera Contributor

Hi All,

I have a requirement to archive the user records with the below conditions. I am not able to create the archive rule neither on the task table nor on the catalog task table.

 

1 - User Type = Agent or Customer AND  does not have an incident/request associated.

 

2 - User Type = Agent or Customer AND has a closed incident/request but is greater than 2 years old.

 

Thanks,

Rooma

5 REPLIES 5

SumanKumarM
Tera Contributor

Hello Roomawaker,

Please try writing server side script on task or sc_task table. Also ensure there would be a performance impact due to running script on large table(s) such as Task.

 - Fetch the records from Task table based on assigned_to with required agent role and conditions you mentioned in your query.

 

Please mark helpful and correct, if it helps you in giving some pointers to kick start.

BR,

Suman. 

Hi Suman,

Do we need to write BR because there is no 'script' field in the archive form?

 

Thanks,

Rooma

SumanthDosapati
Mega Sage
Mega Sage

In Archive rules, you just have option to set field conditions only but not script based conditions.

You can try below approach:

1) Run a background script to get userid list of all users satisfying your above conditions.

2) Now in the Archive rule for sys_user table add the condition as userid 'is one of' the list you got in BG script.

 

Regards,

Sumanth

Hi Sumanth,

If we use Background script , it would be of one time. We have to use the rule on a timely basis to archive unwanted users.

Is there any other way, we can achieve this?

 

Thanks,

Rooma