How to increase gs.addErrorMesage() display time on service portal.

Meenal Gharat
Giga Guru

Hi All,

Can we extend gs.addErrorMessage() time on Service portal?

I want to trigger Error Message When user's Manager is not assigned. Message is getting displayed but it disappears after few seconds can we extend the time for error message?

Below is my code which I have added on server controller part of a widget.

 

var grUser = new GlideRecord('sys_user');
grUser.get(gs.getUserID());
grUser.query();
if(grUser.next())
{

 if(grUser.manager =='' )
 {

 gs.addErrorMessage("Manager field is empty");
 }

}

 

Thanks and Regards,

Meenal

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Meenal,

there is 1 system property; try to check the value for that

glide.service-portal.notification_timeout.seconds

I think default is 5; but try to increase to 10 or 20 seconds and check;

a value of zero disables auto-dismissal i.e. message will be shown unless user clicks cross icon

Note: this would be a global change

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Maybe this article contains what you are after:
addMessage popup is inconsistently disappearing or staying up in the service portal
I
t contains "In London, a system property has been added to configure the message timeout."

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

Thank you for replying.

 

Regards,

Meenal Gharat

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Meenal,

there is 1 system property; try to check the value for that

glide.service-portal.notification_timeout.seconds

I think default is 5; but try to increase to 10 or 20 seconds and check;

a value of zero disables auto-dismissal i.e. message will be shown unless user clicks cross icon

Note: this would be a global change

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur ,

 

Thanks for the help, It worked.

 

Regards,

Meenal gharat