Cannot delete CI records

Saeka
Kilo Sage

I previously created an extended table for CI and created records in it.

The table is no longer needed, so I deleted it, but the records remain in the parent CI table and cannot be deleted.

 

I have tried background scripts, but can you please tell me the cause and how to delete it?

 

The Class field has the value "label".

 

IzakiSaeka_0-1685406167630.png

 

1 ACCEPTED SOLUTION

If you have not deleted the records before deleting the table, then it is better to raise a hi-ticket asking ServiceNow to assist

View solution in original post

5 REPLIES 5

kyzzy
Tera Expert

Hi,

I had the same issue, and I managed to delete the incorrect record.

First, I updated the sys_class_name and class_category fields at the same time from background script, then I deleted the record.

var table = 'TableNameWhereTheRecordExists';
var sysId = 'SysIdOfTheRecord';
var correctClassCategorySysId = 'xxxxa56a1baf399097c1620abb4bcxxxx';
var correctClassName = 'u_testtable';

var gr = new GlideRecord(table);
gr.addQuery('sys_id', sysId);
gr.query();
if(gr.next() )
{
gr.class_category= sysIdNewClassCategory;
gr.sys_class_name= correctClassName;
gr.update();
}