The CreatorCon Call for Content is officially open! Get started here.

Why in Glide Form API , the method addFormMessage(String message, String type) is not working?

Sushma Kumari K
Tera Contributor

In Glide Form API, the method g_form.addFormMessage(String message, String type) is not working properly. When I am using this method without g_form, it's giving correct output in the form. Why is it so happening?

1 ACCEPTED SOLUTION

Pedro Grilo1
Mega Sage

Hi,

 

addFormMessage is part of some UI scrips/pages and, for that reason, the function gets loaded into the page (as an example, the "Add to Visual Task Board" has that function). I don't believe it is intended to work with g_form.

Looking at the scripts where we can find it, it uses GlideUI call:

GlideUI.get().addOutputMessage({msg: msg, type: type, id: id});

 

I hope the above helps!

 

Pedro

View solution in original post

3 REPLIES 3

Pedro Grilo1
Mega Sage

Hi,

 

addFormMessage is part of some UI scrips/pages and, for that reason, the function gets loaded into the page (as an example, the "Add to Visual Task Board" has that function). I don't believe it is intended to work with g_form.

Looking at the scripts where we can find it, it uses GlideUI call:

GlideUI.get().addOutputMessage({msg: msg, type: type, id: id});

 

I hope the above helps!

 

Pedro

rajeev17
Mega Guru

Hi Sushma ,

Please refer below article:

https://community.servicenow.com/community?id=community_article&sys_id=0b231b4bdb9c7308fff8a345ca961953

Regards,

Rajeev

 

Please mark it helpful if i have answered your query.

 

rajeev17
Mega Guru

Hi Sushma,

You can use g_form.addInfoMessage();

g_form.showFieldMsg();

Regards,

Rajeev