checking duplicate record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 11:36 AM
Hello Team,
I'm trying to write a script includes with catalog client script onChange. I have an xyz custom table that has these fields and values:
Full name HR course
John HR course name A
If John selects HR course Name A, but he already enrolled for this course. The form should alert him and clearValue (some type of onChange and clearValue method). Basically, the form tries to prevent user to have duplicate record on catalog client script. I don't know if you have any sample script that has similar requirement. Please let me know. Thanks for your help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 11:58 AM
There are several ways to do this.
The simplest is to do a GlideRecord query and check to see if the record already exists for Full Name and HR Course and if it does then set the HR course field to a blank value. Whether or not I use a client side GlideRecord call will depend on how many columns are in the table. If there are very few I would go with it, but if there are a lot then you may want to use a rest call to the table api so you can limit the amount of data returned.
Client side GlideRecord API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 10:02 AM
Thanks for the reply. I figured out how to do this one.