nerdexam
ServiceNow

CAD · Question #220

Which method in the GlideRecord API is used to update a record in the database?

The correct answer is A. gr.update(). The gr.update() method within the GlideRecord API is specifically used to save changes made to an existing record in the database.

Submitted by kavita_s· Apr 18, 2026Designing and Creating an Application

Question

Which method in the GlideRecord API is used to update a record in the database?

Options

  • Agr.update()
  • Bgr.insert()
  • Cgr.save()
  • Dgr.setValue()

How the community answered

(28 responses)
  • A
    89% (25)
  • B
    4% (1)
  • C
    7% (2)

Why each option

The `gr.update()` method within the GlideRecord API is specifically used to save changes made to an existing record in the database.

Agr.update()Correct

The `gr.update()` method saves any changes made to the current GlideRecord object to the database, effectively updating the corresponding record. It is essential for persisting modifications to existing records within server-side scripts.

Bgr.insert()

`gr.insert()` is used to create a new record in the database, not update an existing one.

Cgr.save()

`gr.save()` is not a standard GlideRecord method for persisting changes; typically, `insert()` or `update()` are used.

Dgr.setValue()

`gr.setValue()` is used to set the value of a specific field on a GlideRecord object, but it does not save the changes to the database.

Concept tested: GlideRecord record update method

Source: https://docs.servicenow.com/bundle/utah-application-development/page/app-store/dev_portal/API_reference/GlideRecord/concept/gr-update.html

Topics

#GlideRecord API#Record Update#Database Operations#Server-side Scripting

Community Discussion

No community discussion yet for this question.

Full CAD Practice