Cannot delete a record

Ken83
Mega Guru

Hello Community,

        I have 2 records on my sys_user_group table that I cannot delete. I'm not getting any errors though. From the list view, I check the box beside the record, scroll down to the bottom and use the drop down and choose delete. The screen reloads and the records are still there. When I click into the record, I click the delete button. The screen reloads and the record is still there.

The strange part is when I right click the record in the list view, and click "Copy Sys_id", the sys_id of the group is actually the name of the group. So i'm assuming these 2 records are just corrupted some way but I cannot delete them. Any suggestions on how I can get rid of these 2 records? I believe they are causing a problem on the sys_user_grmember table.

1 ACCEPTED SOLUTION

Run following background script:


gs.sql("DELETE FROM sys_user_group WHERE name='Support'");


View solution in original post

11 REPLIES 11

saritha9
Giga Expert

I am assuming you have correct access to delete the Groups. Try to remove cache and see if they are already deleted. If not try to run a background script to delete those two groups using GlideRecord. Even if that doesn't work then write a background script something like gs.sql("DELETE FROM sys_user_group WHERE name=xxxx");


Yes, I am admin and I ran a background script on the 2 records and nothing changed.



var gr = new GlideRecord('sys_user_group');


gr.get('sys_id', '=', 'Support');


gr.deleteRecord();


Try changing your get to:


gr.get('sys_id', 'Support');


Run following background script:


gs.sql("DELETE FROM sys_user_group WHERE name='Support'");