unable to delete record through background script also getting this message "Inheriting workflow flag value 'false' for deletion of record '6cfece73db7a4cd05b74f9b2f3961936' from sub-class 'cmdb_ci_win_server'"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2021 05:35 AM
Hi,
I could not able to delete one server record through background script
getting this message after running it. Please help me out on this how can i do this.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2021 12:47 AM
Hi Sai,
Please check if any ACL blocking you to delete that specific record on that table. May be that is the cause. Are you able to delete it with same access from List Layout?
Thank you
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2021 08:06 AM
"Inheriting workflow flag value 'false' for deletion of record '6cfece73db7a4cd05b74f9b2f3961936' from sub-class 'cmdb_ci_win_server'"
This message is generated because you are querying the cmdb_ci_server and try to delete the child record present on cmdb_ci_win_server. You can ignore this message.
There is some other issue due to which record failed to delete. Can you try it without using the setWorkflow ?
var gr = new GlideRecord("cmdb_ci_server");
gr.addEncodedQuery('name=azeunwnsp004^ORu_computer_name=azeunwnsp004^ORasset_tag=azeunwnsp004')
gr.query();
gs.print(gr.getRowCount());
while(gr.next()){
//gr.setWorkflow(false);
gr.deleteRecord();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2021 12:06 PM
Hi Pranesh,
As suggested, i had commented setWorkflow but still it is not deleting the record.
Inheriting workflow flag value 'true' for deletion of record '6cfece73db7a4cd05b74f9b2f3961936' from sub-class 'cmdb_ci_win_server'
Now getting this message after running the background script.
Basically my issue is, when you click on "i" icon from list view the record is not found that means record deleted.
But in list view it is still showing with the details and it is impacting billing.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2021 10:54 PM
Can you share a screenshot?
are you getting something from gs.print?
gs.print(gr.getRowCount());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2024 10:59 AM
It could be that the parent table still has that record and if you try to open that record it will show up as "Record not found" so instead of deleteRecord, try deleteMultiple, make sure your query is correct otherwise it will delete all the records
Test this in a lower environment, and always be cautious when deleting and test this thoroughly, as deletion is a dangerous operation always.