Skip to content

Commit 44deb4e

Browse files
authored
Get the current version of any application. (#1502)
* currentversionscript.js * readme.md
1 parent 1baacb4 commit 44deb4e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Replace 'Project Workspace' with the name of the application you want to check
2+
var appName = 'Project Workspace';
3+
4+
var appRecord = new GlideRecord('sys_app');
5+
appRecord.addQuery('name', appName);
6+
appRecord.query();
7+
8+
if (appRecord.next()) {
9+
gs.print("Application Name: " + appName);
10+
gs.print("Current Version: " + appRecord.getValue('version'));
11+
} else {
12+
gs.print("The Application '" + appName + "' is not found.");
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- Set the appName variable to the exact name of the application you’re checking (in this case as an example, Project Workspace).
2+
- This script queries the Application [sys_app] table for a record with the specified name.
3+
- If the application is found, it retrieves and prints the version. If not, it prints a message stating the application wasn’t found.
4+
- This script will find the version of a specific application and output the version in the Scripts - Background logs.
5+
6+
7+
8+
9+

0 commit comments

Comments
 (0)