var queryParam='email';
checkDuplUsers(true, queryParam);
function
checkDuplUsers(activeUser, queryParam){
var ga= new GlideAggregate('sys_user');
ga.addAggregate('COUNT', queryParam);
if (activeUser){
ga.addActiveQuery();
}
ga.addHaving('COUNT', '>', 1);
ga.query();
gs.log("The
following " + ga.getRowCount() + " users are duplicate on " + queryParam);
while (ga.next()) {
gs.log("GatherDuplicates
" + queryParam + " " + ga.getAggregate('COUNT', queryParam) + " => " + ga.getElement(queryParam));
}
}
Comments
Post a Comment