Exam4Training

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

Which of the following methods prints a message on a blue background to the top of the current form by default?
A . g_form.addInfoMsg()
B . g_form.addInfoMessage()
C . g_form.showFieldMessage()
D . g_form.showFieldMsg()

Answer: B

Explanation:

From: https://docs.servicenow.com/bundle/paris-application-development/page/script/general-scripting/reference/r_ScriptingAlertInfoAndErrorMsgs.html

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. Pg 126 of the CAD handbook

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.

Reference: [ServiceNow Docs – GlideForm (g_form) API], [ServiceNow Docs – g_form.addInfoMessage()]

Latest CAD Dumps Valid Version with 60 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version