Notifications

6 views

Description

HR profiles are created automatically when a user visits the HR Portal

Resolution

Per OOB functionality, an HR profile is automatically created when a user accesses the HR Service Portal for the first time.

The logic for this is stored on line 2 of (HRI Header) widget below:
https://signifdevy.service-now.com/nav_to.do?uri=sp_header_footer.do?sys_id=f9e232209f22120047a2d126c42e70b0

Line 2 of Server Script section:
// HR Profile
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('user', gs.getUserID());
gr.query();
if (!gr.next()) {
gr.setValue('user', gs.getUserID());
gr.insert();
}

The same logic is also present in (HRI My Information) widget below:
https://XXinstanceNameXX.service-now.com/nav_to.do?uri=sp_widget.do?sys_id=7de232209f22120047a2d126c42e70ba

var userId = gs.getUserID();
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('user', userId);
gr.query();
if (!gr.next()) {
gr.setValue('user', userId);
gr.insert();


Article Information

Last Updated:2019-11-30 11:52:47
Published:2019-11-30