How to delete HR profiles in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2020 04:15 AM
Dear Experts,
We have recently implemented the HRSD application in our instance. All the active user profiles have been converted in the HR profiles, of late we decided to remove contractors and other users from HR Profiles as they are not relevant. I know we can hard delete the profiles but it is very time-consuming.
Is there a way to remove the HR Profiles?
Best Regards,
Gowdash
- Labels:
-
Case and Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2020 04:22 AM
Hey gowdash,
Make a scheduled job and delete those records.
Otherwise,
if you will do this by background script then system will not take that much load and can't able to delete those records instantly as number of records is very high.
So, go with scheduled job.
Just a sample:
//Set query as per your requirement
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('sys_created_on', '>', "25-08-2020" );
gr.query();
gs.info("Returned Record" + gr.getRowCount());
gr.deleteMultiple();
Mark Correct and Helpful, if it helps!
Best Regards,
Namrata.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 09:30 PM
Hey gowdash,
Is your issue get resolved or do you require further information regarding this?
If so, Kindly mark my answer correct and helpful on the basis of impact!
Best Regards,
Namrata.