Performance Issue on Reference Qualifier

Pullela sony2
Tera Contributor

We have written one script include in global scope and calling it in Reference qualifier of Human resource:core scope.

We have one field referencing to user table in which we have reference qualifier to advanced from that we are calling script include. when we search its taking almost 3 to 4 minutes to get the users into the reference field.

 

Currently we have 60k records in the HR profile table.

 

below is my code:

 

getUsers: function() {
        var arr = [];
        var grManager = new GlideAggregate("sn_hr_core_profile");
        grManager.addEncodedQuery('u_employment_statusNOT LIKETerminated');
        grManager.query();
        while (grManager.next()) {
            arr.push(grManager.user.toString());
        }
       
        return 'sys_idIN' + arr;
       
    },

reference:
javascript: new scriptIncludeName().getUsers()

0 REPLIES 0