nerdexam
ServiceNow

CAD · Question #48

When writing a Client Script to provide feedback targeted at a specific field, which method should be used?

The correct answer is B. g_form.showFieldMsg(). This question asks for the correct g_form client-side method to display a message associated with a specific form field.

Submitted by brentm· Apr 18, 2026Application User Interface

Question

When writing a Client Script to provide feedback targeted at a specific field, which method should be used?

Options

  • Ag_form.showInfoMessage()
  • Bg_form.showFieldMsg()
  • Cg_form.addInfoMessage()
  • Dg_form.addFieldMsg()

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    87% (26)
  • C
    7% (2)
  • D
    3% (1)

Why each option

This question asks for the correct `g_form` client-side method to display a message associated with a specific form field.

Ag_form.showInfoMessage()

`g_form.showInfoMessage()` displays a general information message at the top of the form, not targeted to a specific field.

Bg_form.showFieldMsg()Correct

The `g_form.showFieldMsg()` method is used in client scripts to display a message directly below a specified form field, making the feedback context-specific.

Cg_form.addInfoMessage()

`g_form.addInfoMessage()` is an older or less common method that also displays a general message at the top of the form, without field specificity.

Dg_form.addFieldMsg()

`g_form.addFieldMsg()` is an older or less common method for displaying a field-specific message; `showFieldMsg()` is the preferred and more commonly used method for this purpose.

Concept tested: Client script field-specific messages

Source: https://docs.servicenow.com/bundle/utah-application-development/page/script/client-scripts/reference/r_ClientScriptAPI.html

Topics

#Client Script#g_form API#Form Messages#User Interface

Community Discussion

No community discussion yet for this question.

Full CAD Practice