We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de3ed58 commit de1f7c2Copy full SHA for de1f7c2
Server-Side Components/Background Scripts/Check Number of Active Records per Table/script.js
@@ -0,0 +1,22 @@
1
+// Script: Check Number of Active Records per Table
2
+// Author: Bhavya
3
+// Use: To count active records in multiple tables
4
+
5
+(function() {
6
+ // List of tables you want to check
7
+ var tables = ['incident', 'change_request', 'problem', 'task'];
8
9
+ gs.print('Active Record Count per Table');
10
11
+ for (var i = 0; i < tables.length; i++) {
12
+ var tableName = tables[i];
13
+ var gr = new GlideRecord(tableName);
14
15
+ // Filter for active records
16
+ gr.addQuery('active', true);
17
+ gr.query();
18
19
+ var count = gr.getRowCount();
20
+ gs.print(tableName + " - Active Records: " + count);
21
+ }
22
+})();
0 commit comments