Name
global.SubscribedUserAjax
Description
Query the cmn_notif_message table to determine how many users are subscribed to a given notification.
Script
var SubscribedUserAjax = Class.create();
SubscribedUserAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getSubscriptionCount: function() {
if (gs.getProperty("glide.notification.use_legacy_subscription_model", "true") == "false")
return 0;
var count = new GlideAggregate("cmn_notif_message");
count.addQuery('notification',this.getParameter('sysparm_sys_id'));
count.addAggregate('COUNT');
count.query();
var subscribers = 0;
if (count.next())
subscribers = count.getAggregate('COUNT');
return subscribers;
}
});
Sys ID
e5426321d7102100f416ee9c5e61034d