- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 10:37 AM
I m using Flushmessage in Business rule to remove the error message which i added on the form. But i m getting an error message as "Function flushMessages is not allowed in scope x_opt_"
Could someone help me with alternate approach... Should i be using client script/script include to provide an error message or any other options?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 10:46 AM
You are correct. gs.flushMessages() is not available in scoped apps. Have you considered using g_form.clearMessages() from a client script?
https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GS-flushMessages
If you feel this is a critical method to use in scoped apps, I invite you to open an enhancement request! Our product managers DO listen.
Enhancement requests: Tell us how you would improve the ServiceNow product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 10:42 AM
Can you share the the code
i think flushMessages is function which is not allowed in scoped application

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 10:46 AM
You are correct. gs.flushMessages() is not available in scoped apps. Have you considered using g_form.clearMessages() from a client script?
https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GS-flushMessages
If you feel this is a critical method to use in scoped apps, I invite you to open an enhancement request! Our product managers DO listen.
Enhancement requests: Tell us how you would improve the ServiceNow product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 10:52 AM
Thanks ctomasi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2019 11:23 PM
g_form.clearMessages() doesn't seem to work in Service Portal. Do we have any alternate method to clear messages shown on top of the page using g_form.addErrorMessage() and g_form.addInfoMessage()?