How to delete duplicate catalog item draft
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hi all,
I need to delete duplicate catalog item draft. I need to only keep last created. There is one question 'Jira ID' where I am getting unique value from Jira, Based on that question's value I have do the glide aggregate count. If the count is greater than 1 (means there are more than 1 record where Jira Id is same) then I will only keep the latest one.
How can I write this glide aggregate code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Obito,
in Portal go to My requests and there is Draft tab where yo ucan erase it:
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@Obito or in the backend go to [sc_cart_item] table:
https://yourinstance.service-now.com/now/nav/ui/classic/params/target/sc_cart_item_list.do
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @GlideFather , Thank you for the response, But I need to delete the records using script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@Obito and by what script - BR, catalog client script (calling Ajax), scheduled job, flow, .... ?
Not knowing your conditions, to delete it always or under conditions, for all user or just some...?
Then you can write your code accordingly pointing to the table I shared [sc_cart_item].
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */