john_roberts
Mega Guru
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
ā03-07-2013
02:34 PM
Just saw this gem on our internal Live Feed from our resident wizard Mr. Goodliffe. The question on Live was how can I easily locate users with duplicate email addresses. I've always used a GlideAggregate script running in background scripts which really limits it to admins and can't view the results in a list.
Solution:
Create a client callable script include to perform a query for duplicate records, then call that script from a list filter.
More info on GlideAggregate
* Script Include:
/*
Client callable script include used for filtering sys_user lists
to identify duplication email users
name: duplicateEmail
active: true
client callabe: true
*/
function duplicateEmail() {
var xx = new GlideAggregate('sys_user');
xx.addAggregate('COUNT', 'email');
xx.addHaving('COUNT', 'email', '>', '1');
xx.query();
var answer = new Array();
while (xx.next()) {
answer.push(xx.getValue('email'));
}
return answer;
}
* Call the script from a filter. Open the list of users, apply filter Email - is - javascript:duplicateEmail();
* Run it and view the list of users that have duplicate email values
- 7,447 Views
27 Comments
- « Previous
-
- 1
- 2
- 3
- Next »
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.