- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 08:30 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 08:53 AM
Run following background script:
gs.sql("DELETE FROM sys_user_group WHERE name='Support'");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 08:59 AM
I'm assuming that Kenneth is using 'Support' in his script as an example, as that wouldn't be a valid sys_id.
I just saw that when he does the copy sys_id action it puts this here, disregard.
If he wanted to delete a group with the name 'Support', it would look like:
var gr = new GlideRecord('sys_user_group');
gr.get('name', 'Support');
gr.deleteRecord();
If there is another way you can identify the record (like name above), try that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 09:07 AM
Thank you for that! Where does this gs.sql come from? I've never seen it before? Any documentation or anything about that? I've been using database queries all weekend on other platforms so I got excited when I saw that. I worked btw i'm just looking to gain better understanding on how that can be utilized
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 08:42 AM
It may be a caching issue in the browser. Either log out of your currect session and log back in and see if the records are still there or also try to use a different browser and see if the records are there. Is this a prod or dev instance? For a dev instance, you can try cache.do. View this article first at the bottom, section 5.
Troubleshooting Performance - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 08:59 AM
I had a similar issue with records not deleting. I had to contact SN Tech support to have someone do the delete for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2015 09:03 AM
Yup, that sounds definitely like something support will have to clean up from behind the scenes.