I can't delete record form location table

jaouad_essabir
Mega Contributor

Hello,

This is my first training on the ServiceNow, so i want to delete all the record from location table and import new record, but i can't delete all the record because of this message:

"Delete of 615 North Bush Street, Santa Ana,CA not allowed because of a reference in record Southern California Warehouse within the Stockroom file"

find_real_file.png

each record has a parent record on the same table, and this parent record has a parent record on the same table...etc

so it's impossible to delete 17 records.

Have u any help ? by using manuel delete, by script or other ?

Thanks for your help

Regards

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

In a hierarchical configuration, you need to delete all the records the "end" records that have no children first. Once you have those, then you do it again and again until you reach the top of the tree structure. It's an iterative process in this case where you have parent records. Otherwise you could end up with a big mess with children referencing parents that aren't there.


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

In a hierarchical configuration, you need to delete all the records the "end" records that have no children first. Once you have those, then you do it again and again until you reach the top of the tree structure. It's an iterative process in this case where you have parent records. Otherwise you could end up with a big mess with children referencing parents that aren't there.


It's OK but is a big work...to delete one by one


Thanks


Thanks for the feedback Jaouad.



You should be able to delete "level by level" for those records that have no children. A bit like cutting down a tree. Just lop off the branches that have no sub branches and eventually you get to the trunk.


I Tried to delete the child records and then Parent records.



Out of 45 OOTB Location records there are 10 location records unable to delete. These 10 records do not have any child record.


find_real_file.png



Kindly help here to delete all Location Records.



Thank you.


Regards,


Supriya S.