Why am I unable to delete certain records?

HedgeHodge
Tera Contributor

Under the "core_company" table, I have two records which are unable to be deleted. When deleting via the delete button, it simply does nothing and the records are still there. When attempting to delete via script, I get this 

find_real_file.png

I've also tried this 

gs.sql("DELETE FROM core_company WHERE sys_id='09c978f91b02c95080de1133b24bcba8'");

The only thing I am seeing in the debugger is this.

GlideRecord newGlideRecord() called with invalid table name: Company
4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Tyler,

 Please try the below script.

var compGr = new GlideRecord('core_company');
compGr.addQuery('sys_id','09c978f91b02c95080de1133b24bcba8');   
compGr.query();
if(compGr.next())
{
compGr.setWorkFlow(false);
compGr.deleteRecord();
}

 

- Pradeep Sharma

Hello, Pradeep.

We tried running the script but I think the record is not deleting because the record is acting as a "ghost" record. When I query it, it does show up. It also shows on the list view but when you actually open up the record it says "page not found".

And also, I found there are one more duplicate record at the same time.
but they have two different sys_id.

Hi Chang,

Maybe it's in the cache. Enter cache.do to flush the cache and see if the record still shows.

Unfortunately, it still does show up. I cleared the cache multiple times, just in case.