Glide record HR profile table to fetch Employee number and Domain ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2021 08:57 AM
I need to auto populate Employee number and domain id of the logged in user once the Service is opened from the portal.
I am writing an onLoad function in catalog client script and glide recording the sn_hr_core_profile table. number is the unique field in HR Profile table. But I am receiving an undefined message at the alert i used alert(g_user.number);. Can you please suggest me what i m missing here.
function onLoad() {
var reqgr = new GlideRecord('sn_hr_core_profile');
reqgr.addQuery('sys_id', g_user.number);
alert(g_user.number);
reqgr.query();
while(reqgr.next())
{
g_form.setValue('us_domain_id', reqgr.u_domain_id);
g_form.setValue('employee_number', reqgr.employee_id);
}
}
Let me know if anything needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2021 02:27 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2021 01:50 AM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
