Deletion of bulk records for the Legacy sn_hr_core_case_relations table

Simanta27
Tera Contributor

Hi everyone,

We are not using the legacy sn_hr_core_case_relations table in our instance anymore, but we have bulk records from the legacy sn_hr_core_case_relations table in our instance which was migrated in a data migration process, any idea on how can we delete these records? Background scripts or manual deletion is not working as it's unable to find the table in the instance.

Thank you in advance. 🙂

8 REPLIES 8

Sayali Gurav
Tera Guru
Tera Guru

Dou you want to delete all records or specific records from that table?

https://www.servicenow.com/community/platform-analytics-forum/delete-multiple-records-using-backgrou... - Refer this link for solution.

 

Specific records of that table.

Shaqeel
Mega Sage

Hi @Simanta27 

 

You can use script.

 

javascript

var gr = new GlideRecord('sn_hr_core_case_relations');

gr.addQuery('field_name', 'field_value'); // replace field_name and field_value with the actual field name and value gr.query();

while (gr.next())

{ gr.deleteRecord();

}

 

Kindly mark helpful/Solution.

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel