
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2019 04:43 PM
Hello SN Comm!
I am working on script a Fix Script, in order to update many, many records for HR Cases.
Here is what I have as of right now:
var gr = new GlideRecord('sn_hr_core_case');
gr.addQuery('topic_category', 'system issue');
gr.addQuery('topic_detail', 'system issue');
gr.addQuery('hr_service', 'legacy_misc');
gr.addQuery('short_description', 'CONTAINS', 'Workday Password Reset');
gr.query();
while (gr.next()) {
gs.info('fixLegacyMiscCases: I would fix ' + gr.getRowCount() + " records."); //Check script before running - does it return correct number of records?
//gr.topic_category = 'Accounts / Access Control';
//gr.topic_detail = 'Password Reset';
//gr.hr_service = 'workday_password_reset';
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
However, when I run the script, I just get a message on how long it took to run, but no record count shows up.
And the time ran returns 00:00:04. So, I know it didn't do a thing.
Anyone able to help out what is wrong? I have tried a couple of ways with the format of the script. For example, in my addQueries - I had gr.addQuery("topic_category", 'system_issue'); - and so on for all of them. But the results have been the same no matter what.
Thanks in advance if anyone can help me!
-Rob
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 07:58 AM
I learned that the output I was getting (while large), was simply just telling me that the script was running. I attacked a small number of Cases within my fix script, and it did what I needed - updated those Cases as I needed them to be. Hit the right Cases and changed what I wanted corrected within my script.
Thanks everyone for the help here!
Closing post as the script is working correctly.
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2019 06:17 PM
Vinod Kumar Kachineni
Community Rising Star 2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2019 07:00 PM
Added gs.info life right after the gr.query - same results.
Just showed the time it ran and that was it.
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2019 06:24 PM
Hi Rob,
It most likely is being blocked by the Application Restricted Caller Access. For functionality like this you would have to have the fix script call to a script include in the script's scope.
Just an idea of what this could be.
Regards,
Mike

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2019 07:04 PM
Oh boy Michael - any idea how I would go about doing that?
I went to the list of Application Restricted Caller Access - filtered to show all HR:Core for the source scope. And we have 17 that are there.
If this is the case, how would I validate it to be the blocker?
Thanks,
-Rob