- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 06:10 AM
Hello,
I am trying to create a client script targeting the customer_contact table to prevent contacts from being created with the same email address as another contact. However, the script below is not working and I feel sure I am just missing something. Any thoughts?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 03:23 PM
@cboyd12 ,
ServiceNow recommends against using glideRecord in client scripts. I would advise implementing this logic in a before insert business rule.
GlideRecord - Global (servicenow.com)
Additionally, in the client script, after the "throw new error" line, there is no "return false." Please add "return false" after it and check if that resolves the issue with the client script.
Please mark helpful or accept solution.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 03:23 PM
@cboyd12 ,
ServiceNow recommends against using glideRecord in client scripts. I would advise implementing this logic in a before insert business rule.
GlideRecord - Global (servicenow.com)
Additionally, in the client script, after the "throw new error" line, there is no "return false." Please add "return false" after it and check if that resolves the issue with the client script.
Please mark helpful or accept solution.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 05:53 AM
Ah okay, thanks for the feedback and resource!
Thanks!