- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi, I've already created an Advance Reference Qualifier in Variable Set for Opened For/ Subject Person referenced to table [sys_user] and to filter only users with HR Profiles but since this is a query, loading of users in drop down takes 3-5 seconds before showing and it is a bad user experience.
Is there any way to optimize it?
Variable setup:
Script Include:
var NMHRProfileUtils = Class.create();
NMHRProfileUtils.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
initialize: function() {},
getListUsersWithHRProfile: function() {
var ids = [];
var gr = new GlideRecord('sn_hr_core_profile');
gr.addNotNullQuery('user');
gr.query();
while (gr.next()) {
ids.push(gr.getValue('user'));
}
if (ids.length === 0) {
return 'sys_id=NULL';
}
return 'sys_idIN' + ids.join(',');
},
type: 'NMHRProfileUtils'
});
Solved! Go to Solution.
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Updating my reply. It works now
Here is the setup that we've come up in the variable under variable set.
Then in script on record producer, we use the dot-walk as @palanikumar had mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @pjftenorio ,
I agree with @palanikumar , currently I am working as a solution architect on HRSD module, and I would recommend making the reference field directly to the HR Profile (sn_hr_core_profile) and apply the simple reference qualifier filter, attaching the below screenshot for your reference.
If my response helps you, please mark this as accepted solution and give thumbs up.
Regards,
Abhishek Thakur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Updating my reply. It works now
Here is the setup that we've come up in the variable under variable set.
Then in script on record producer, we use the dot-walk as @palanikumar had mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Since you made the variable point to HR Profile table, you should remove any ref qualifier applies
share your variable config screenshots.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
