Catalog client scripts and record deletion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:47 AM
Greetings,
I have a catalog client script that performs validation on a record producer onSubmit.
I am running into a bit of a problem when I attempt to delete a user record from within the catalog client script.
I found the following Servicenow document that discusses limited use of some GlideRecord functionality inside client side scripts, such as client scripts
However, the code isn't working and I am beginning to believe that the documentation is incorrect and record deletions cannot be performed in client scripts for regular ITIL users.
Below is a snapshot of my catalog client script:
If I can't perform a delete from a catalog client script, does anyone have any recommendations on how I can accomplish my goal of deleting a user record as an ITIL user when validating a record producer?
Thanks much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:53 AM
I usually dont do any server side scripting directly in Client Scripts.
The best SOP for achieving this would be to use Glide Ajax to call the Deletion Script in a Script Include. Now I havent tried deletion via Script include, but I have done other server side operations using Script Include when I need to invoke something from Client Side.
Hope this helps.
http://wiki.servicenow.com/index.php?title=GlideAjax#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:54 AM
You can delete records from client side. The problem here is onSubmit does not support callBack functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 08:59 AM
Hi Solo,
I would seriously recommend you to do Server Side operations via server side scripting like business rule, Scheduled job or script include.
I strongly believe client scripts would not give you the desired results.
Thanks,
Arnab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 05:21 PM
Are you even falling into the condition for deletion?