Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Created May 13, 2024 15:05
Show Gist options
  • Select an option

  • Save cmcdevitt/6dd3563f6f84f931158cb593f38f0395 to your computer and use it in GitHub Desktop.

Select an option

Save cmcdevitt/6dd3563f6f84f931158cb593f38f0395 to your computer and use it in GitHub Desktop.
ServiceNow report progress on a long running script to logs
/*
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