Trying to prevent duplicate users with same email address in my custom user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 12:58 PM
I am writing a client script to stop a user from creating a new user record if the same address is in the system already
function onSubmit() {
//Type appropriate comment here, and begin script below
var currentEmail = g_form.getValue('email');
var newUser = new GlideRecord('table_name');
newUser.addQuery('email', currentEmail);
newUser.query();
if (newUser.next()) {
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2022 01:38 PM
yeah , you can still use this feature, it doesn't matter the scope of the app.
Add unique field in the global for the table Dictionnary Entry [sys_dictionary] and after that switch to your scope to check the field Unique.