Clear messages displayed on the portal

Mi4
Tera Expert

hi,

I am facing a phenomenon where a message remains when I approve it on a portal page(id=hrm_todos_page).
The message can be displayed, but how can I clear the message?

find_real_file.png

Regards,

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi,

If this is on the page and not on the form, then in any of the widget that is shown on the form, run this code.

  • this.g_form.clearMessages();
  • $scope.page.g_form.clearMessages();

If there is any form in this page, then simply use 

g_form.clearMessages() in the onload client script and it will work

Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.

Regards,
Asif
2020 ServiceNow Community MVP

View solution in original post

7 REPLIES 7

asifnoor
Kilo Patron

Hi,

If this is on the page and not on the form, then in any of the widget that is shown on the form, run this code.

  • this.g_form.clearMessages();
  • $scope.page.g_form.clearMessages();

If there is any form in this page, then simply use 

g_form.clearMessages() in the onload client script and it will work

Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.

Regards,
Asif
2020 ServiceNow Community MVP

Hi,

thank you for reply.

Is this a form?

find_real_file.png

 


I guess the widget on this page is true, is that wrong?

HRM Todos Summary:

find_real_file.png

 

Regards,

Hi Mi,

Yes, it's a widget so you need to clone or update the server script message under the widget.

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy.

Thanks,

 

Hi,

Thank you for reply.

Is it correct in the server script, not the client?

Regards,