Delete record(s) via virtual agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 12:45 PM
Hello everyone,
So my question is how can I delete record(s) with virtual agent using a topic.
I did a try with a script action using a simple script with glideRecord and deleteRecord and in the conversation, it says that the record was deleted . But it still exist in the table and it wasn't deleted.
Have you a solution?
Thank you very much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 01:15 PM
You should be able to delete a record using GlideRecord. Can you share your code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 01:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 01:44 PM
Hm, nothing strikes me as immediately wrong at first glance...
Not sure why you're gr.Get'ing the record with its number rather than its sys_id when you have a Reference input to pass into it, i.e. gr.Get(vaInputs.appointment)
(I don't recall offhand, you may need to .toString() that)
But that's more a recommendation to improve the code, not to fix what's broken.
Check the variable log to ensure you got a value for vaInputs.appointment and add in extra logging (i.e. gs.log()) into your GlideRecord query to help debug to ensure that you're getting something from that query before deleting it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 11:08 PM - edited 08-24-2023 11:09 PM
The user may not have delete access to that table. You can trigger a flow from the topic and delete the record as system user.