nerdexam
ServiceNow

CAD · Question #25

Which of the following methods prints a message on a blue background to the top of the current form by default?

The correct answer is B. g_form.addInfoMessage(). g_form.showFieldMsg("field_name", "Hello World", "error"); Puts "Hello World" in an error message below the specified field. g_form.addInfoMessage() or g_form.addErrorMessage() place a blue box message at the top of the screen. The method that prints a message on a blue backgroun

Submitted by javi_es· Apr 18, 2026Application User Interface

Question

Which of the following methods prints a message on a blue background to the top of the current form by default?

Options

  • Ag_form.addInfoMsg()
  • Bg_form.addInfoMessage()
  • Cg_form.showFieldMessage()
  • Dg_form.showFieldMsg()

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    88% (22)
  • C
    8% (2)

Explanation

g_form.showFieldMsg("field_name", "Hello World", "error"); Puts "Hello World" in an error message below the specified field. g_form.addInfoMessage() or g_form.addErrorMessage() place a blue box message at the top of the screen. The method that prints a message on a blue background to the top of the current form by default is g_form.addInfoMessage(). The g_form object is a global object that provides access to form fields and UI elements on a form. The addInfoMessage() method is a method of the g_form object that displays an informational message next to the form header. The message has a blue background color by default, unless it is overridden by a CSS style. The addInfoMessage() method takes one argument, which is the message text to display.

Topics

#Client Scripting#g_form API#UI Messages#Form Customization

Community Discussion

No community discussion yet for this question.

Full CAD Practice