Delete Order and its all related records

Yuvan Raj Kuma1
Tera Contributor

Hello comunity, I wish to know is there a way to delete the customer order using API or I need to write a script/create an API to do it?. I want to delete all the order related details (Order, OrderLineItems, Product Orders, Service Orders, Inventoried, Sold Product and Sold product characteristics)...Thanks in advance ðŸ˜‰

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, I believe that the table API would deliver this for you.

Table API | ServiceNow Developers

However, deletion of records\data via API is not always considered best practice as issues can be difficult to diagnose and you may also risk losing valid data. If the record(s) are not required then I would update them to state of cancelled, active = false, and be sure to include clear details in work_notes and\or closure comments so that your fulfillers can easily see\understand why the task was cancelled and by who.

Community Alums
Not applicable