Clear the old error message when a new one is there, so only show latest error message on a form.

Chandler2
Tera Guru

I see that there is an OOB behavior that whenever there is an empty mandatory field, then saving the form gives error message with the list of field names empty and mandatory.

Now if I fill some of those and try to save again, it gives a new message with the now empty fields but then it doesn't clear out the previous message.

Can I remove the previous message from form if there is a new error message coming on?

So if you see the image below, I would expect the message at the top to go away when the second comes:

find_real_file.png

2 REPLIES 2

Anshu_Anand_
Kilo Sage
Kilo Sage

You can use g_form.clearMessages(); onChange client script

g_form.clearMessages();

BTW Its expected behavior.

Message disappear when you either clear out the message via clicking on crossing X sign at end of message.

The form page is static and no update has happened so message will remains.

Even if you try out in any webpages .The Alert popup only disappear when you click ok or take an action on that popup .

 

If its helpful, please mark answer as correct

 

Regards,
Anshu

We can do can use g_form.clearMessages(); onChange client script but it will be one form at a time.

Is there a way we can apply this system wide in one place?