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

Community Alums
Not applicable

Hi @Ankur Bawiskar,

 

It is still showing up.

 

Regards

Suman P.

@Community Alums 

check my above message

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

Chaitanya ILCR
Kilo Patron

Hi @Community Alums ,

g_form.addFormMessage('Test', 'info');
g_form.clearMessages();

Checked these 2 they are working fine.

I don't think clearAllFormMessages() and clearAlFormMessages() exist.

Check the browser console and see if any error is being thrown.

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

Community Alums
Not applicable

Hi @Chaitanya ILCR,

 

I did the same on onLoad Client Script, it is still showing up on my system.

 

1.png

 

Regards

Suman P.

here you are calling both statements consecutively and you barely will see the message. try with delay and it should clear the message and remove the info parameter in clear function.

g_form.addFormMessage("test", "info");
setTimeout(function(){
g_form.clearMessages();
}, 3000);
If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali