addFormMessage

Community Alums
Not applicable

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.

 

 

1 ACCEPTED SOLUTION

@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

View solution in original post

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

@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.

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

@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.

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

@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?

GlideForm - Client 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Ahmmed Ali
Mega Sage

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

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali