Disable notification for all users using script

Govind Kumar S1
Kilo Guru

Hi all,

I want to disable notification for all users for Temporary purpose. Anyone can suggest me , how to achieve this using Script.

Thanks & Regards

Govind Kumar Sharma

1 ACCEPTED SOLUTION

Help me understand this.



Why do you need to write a script when you can do this by simply unchecking the checkbox?


Or just navigate to user table and add the 'Notification' field to list view. Double click on notification field and select 'Disable' for a record. Now right click on the header and click 'Update All'



11-6-2015 2-28-57 PM.png


View solution in original post

13 REPLIES 13

Hi Kalai/Gurpreet



I tried and found that we can also achieve this using background Script too



var rec = new GlideRecord('sys_user');


rec.addQuery('notification',2);


rec.query();


while (rec.next()) {


  rec.notification = 1;


  gs.print('UserName ' + rec.user_name);


  rec.update();


}



Thanks & Regards


Govind Kumar Sharma


When you can do the same via UI, what is the point in writing a script? Beats me Sir!

I tried this for learning purpose Kalai  


did u write a business rule for this? i have a similar requirement.