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

Hello Ankur,

I have a requirement where we need to increase this error message timeout for 10sec for another portal (esc) and it shouldn't effect the existing service portal configuration (5 sec). Can you please suggest on how to do this ?

Thanks in advance..