HR Profiles Getting created automatically

Uzzawal Agrawa1
Giga Contributor

Hello Experts, 

I am facing a weird issue in a customer instance.  

When an end user (without HR Profile record) is logging in ServiceNow and trying to access the "hrportal" url, system is creating a HR profile for the same user automatically. 

This is not happening in my OOB personal dev. 

Any inputs or comments please ?

Regards,

1 ACCEPTED SOLUTION

marcloding
Kilo Expert

Hi,

 

We had a similar issue. Where HR profiles were being created when a user logged into the Portal. We had to do the following:

Comment out lines of code in the Portal Tables: Header | Footer, We use the 'HRI Header'. (we commented out lines 23-29):

       // 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();
       // }

Please be aware that we create the HR Profile for all supported users when the sys_user record is created and we have SSO setup.

Hope this helps. Also check to make sure that duplicate HR Profiles are not being created when a HR Case is being submitted as well. We had an issue where the support agent did not having access to the user's HR Profile, So it would create a duplicate HR Profile when a ticket was submitted. We had to modify some ACLs for this to work.

Thanks

 

View solution in original post

12 REPLIES 12

Deepak Ingale1
Mega Sage

My approach to troubleshoot this issue would be

 

1) Try to login with user does not have HR Profile, dont go to hrportal and see if HR Profile is getting created

2) Step 1 is required to isolate the issue to make sure profile is only getting created when user visits the service portal

3) Once done, please see in the widget code of the homepage or any other page associated to this portal to see if there is any server side code which makes a call to hr profile table and checks if logged in user has profile created or not, if profile does not exists, then create a new one

 

Note: Please mark reply as correct / helpful if it has answered your original question.

NamrataJain
Tera Expert

Hi,

 

Can you check if the user has role HR_PROFILE_WRITER who is trying to log into the portal?

Generally with this role HR_PROFILE_WRITER you can write into HR Profile table and may be even create a profile if not present.

Try and look for the create and write acl, as I guess there should be an acl which allows new employee  to edit individual profile record. 

 

Also check out this script include hr_Utils where they check the roles of the users for various functionality.

For example: getSubjectPersonUsers

 

Thank you

Best Regards,

Namrata Jain.

Ashok Antony1
Kilo Expert

OOTB is different. It doesn't have any integration to LDAP or any other tool like WorkDay. I am assuming you are facing this scenario due to the fact that your instance has LDAP connectivity and your users are authenticated via SSO.

 

If that is the case, there is a Business Rule "Create HR Profile for Users" which automatically creates Profiles for new users or users who become eligible for HR Profile. You might want to deactivate this if you want to avoid creating HR profiles automatically.

 

There is also a client script that creates a profile "Set HR Profile on Subject Person Change". 

 

A HR profile can be triggered by WorkDay during integration.

Ashok,

We were able to use the BR to trigger the creation of new users for onboarding via a catalog item request (HR LE Case record producer) created on behalf of a referenced Supervisor (requested_for).  We passed the first_name, last_name, and personal email to the record producer to fill the params of the hr_Profile script include and it worked like magic.  I understand that your answer may not solve the OP question, but I wanted to pass on my thanks to you.

Cheerio!