- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 06:38 PM
Contents of OOTB script include "NotificationPreferenceUI"
var NotificationPreferenceUI = Class.create();
NotificationPreferenceUI.prototype = Object.extendsObject(AbstractAjaxProcessor, {
type: 'NotificationPreferenceUI',
isCMS: function() {
var transaction = GlideTransaction.get();
return transaction && transaction.isVirtual();
},
isLegacySubscription: function() {
return GlideProperties.getBoolean('glide.notification.use_legacy_subscription_model', false);
},
isMobile: function() {
return gs.isMobile();
},
isConcourse: function() {
return gs.getPreference('use.concourse') == 'true';
},
isPluginActive: function() {
return GlidePluginManager.isActive('com.glide.notification.preference.ui');
},
isUIPropertyEnabled: function() {
return GlideProperties.getBoolean('glide.notification.preference.ui.enabled', false);
},
enabled: function (options) {
options = options || {};
var check = function(opt, fn) {
if (typeof opt != 'undefined')
return opt;
return fn.call();
};
if (check(options.cms, this.isCMS))
return false;
if (check(options.legacySubscription, this.isLegacySubscription))
return false;
if (check(options.mobile, this.isMobile))
return false;
return check(options.concourse, this.isConcourse) &&
check(options.pluginActive, this.isPluginActive) &&
check(options.uiPropertyEnabled, this.isUIPropertyEnabled);
}
});
What does the following process in the above script do?
isCMS: function() {
var transaction = GlideTransaction.get();
return transaction && transaction.isVirtual();
},
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 06:46 PM
Unfortunately, there is no API reference available for GlideTransaction. Its a java class which you cannot access it directly.
This is what my understanding is
it checks the current transaction and checks if it exists and is virtual. A virtual transaction in ServiceNow typically refers to a transaction that is not initiated by a direct user interaction, such as those triggered by workflows, scheduled jobs, or other automated processes.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 06:46 PM
Unfortunately, there is no API reference available for GlideTransaction. Its a java class which you cannot access it directly.
This is what my understanding is
it checks the current transaction and checks if it exists and is virtual. A virtual transaction in ServiceNow typically refers to a transaction that is not initiated by a direct user interaction, such as those triggered by workflows, scheduled jobs, or other automated processes.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader