How to hide alert message pop up based on the duration or click

ChanchalG
Tera Expert

Hi,

I have a requirement where they want to hide the alert message automatically after some duration or once cursor get click anywhere else in screen.

I want to check if there is any way to decrease/ Increase alert message popup duration and if we can configure something on click.

Thanks,
Chanchal

ChanchalG_0-1742392379704.png

 

1 ACCEPTED SOLUTION

Hello,

I have raised a case with ServiceNow. and its seems this system property (glide.service-portal.notification_timeout.seconds) should work but if the UI accessibility user preference is enabled this system property will not work.

so if you want a time out accessibility user preference should be disabled.

View solution in original post

10 REPLIES 10

Shivalika
Mega Sage

Hello @ChanchalG 

 

There is nothing OOB funcnality to do this. But this can be implemented by custom approach using jQuery. 

 

(function executeRule() {

    // Wait for ServiceNow to load the messages

    setTimeout(function () {

        $(".outputmsg_div").fadeOut("slow"); // Hides the message after 5 seconds

    }, 5000);

 

    // Hide the message when user clicks anywhere

    $(document).on("click", function () {

        $(".outputmsg_div").fadeOut("slow");

    }

);

 

})();

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOw

NeEISQCY

But where to write this code. These alerts are coming from mandatory check in catalog item and the widgets are read only.

Hello @ChanchalG 

 

Thanks for clarifying it. I was assuming this is a custom client script or something that you have added. 

 

In that case there is another option that is to modify the system property for display time of these messages. But this is not recommended and it will affect the platform as a whole. 

 

Something related to notification duration should be the property. Kindly check in your table. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Hi, That system property is for info and error messages only.