Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

how can I set notification/system notification true from code (not ui by clicking)?

AlexandraSz
Tera Contributor
 
8 REPLIES 8

glideFather
Tera Patron

Hi @AlexandraSz,

can you please elaborate a bit more? This is too vague to understand your goal..


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

as I wroted below:
there's this screen:

AlexandraSz_0-1760094420123.png

and a I want toggle the System notification from code, not from UI because there are too many users who need to configure this

miftikhar20
Kilo Patron

Hi @AlexandraSz,

You can use this Glide function: setActive(GlideRecord notification, Boolean active)
It sets the user preference for a destination to receive or not receive notifications.
Link: PreferenceDestination - Scoped, Global | ServiceNow Developers

If my response helped, please mark it as the accepted solution so others can benefit as well.

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

AlexandraSz
Tera Contributor

I want to sent emails some users, and some of them didn't get email, because their notification is on, but their system notification is off. I don't want to check hundreds of users manually one by one if they have it enabled or not. I want to set it for the users in bulk, preferably from code.