Created
May 13, 2024 15:05
-
-
Save cmcdevitt/6dd3563f6f84f931158cb593f38f0395 to your computer and use it in GitHub Desktop.
ServiceNow report progress on a long running script to logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Some times it is nice to know if you script is still running.... | |
| */ | |
| var deleted_count = 0; | |
| // Some GlideRecord stuff herre | |
| while (pgr.next()) { | |
| //Some processing stuff here | |
| deleted_count++; | |
| if (deleted_count % 100 == 0)//Report out every hundredth time | |
| gs.warn("Deleted so far: " + deleted_count); | |
| } | |
| gs.warn("Total deleted: " + deleted_count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment