- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:15 AM
Hi,
Looks like new methods have been added in Rome, but never used them, when I try to use them they are not working. Kindly help.
g_form.addFormMessage('Test', 'info');
g_form.clearFormMessages('info');
g_form.clearAllFormMessages();
g_form.clearMessages();
The message is added, but no matter the clear options I use, it is not getting removed. Kindly help.
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:40 AM - edited 12-31-2024 04:42 AM
@Community Alums ,
remove or comment the 4th line (clearFormMessage). Browser would have thrown and error as the method doesn't exist and stopped executing the 5th line. did you find any errors in the console?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:21 AM
@Community Alums
this should work not sure about others
g_form.clearMessages();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:23 AM
@Community Alums
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:25 AM
@Community Alums
refer docs from Xanadu, all the functions are present in docs and should ideally work. Also check in docs if there are any limitations on those
Where are you using those?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 04:22 AM
Hello @Community Alums , t
The method to clear messages is g_form.clearMessages();
g_form.addFormMessage("test", "info");
setTimeout(function(){
g_form.clearMessages();
}, 3000);
try above script, the message will appear for 3 seconds and clear. Tested in PDI.
Thank you,
Ali
Thank you,
Ali