Courseiva
User Interface DevelopmenteasyMultiple ChoiceObjective-mapped

SNOW-CAD User Interface Development Practice Question

Exhibit

Refer to the exhibit.
```javascript
// Client Script (onChange)
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading) return;
   g_form.setValue('short_description', 'Updated');
}
```

The client script above runs on a text field's onChange event. When the user changes the field, the 'short_description' field is not updated. What is the most likely reason?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The 'short_description' field is defined as read-only on the form.

G_form.setValue() cannot update a read-only field. If 'short_description' is defined as read-only on the form, the script will fail to change its value. Option A is incorrect because a missing semicolon would not prevent the field update; JavaScript allows optional semicolons. Option C is incorrect because g_form is available in onChange client scripts. Option D is incorrect because the onChange event fires after the new value is assigned to the field, so the script runs with the updated value.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The script is missing a semicolon after the setValue statement.

    Why it's wrong here

    Missing semicolons do not prevent execution.

  • The 'short_description' field is defined as read-only on the form.

    Why this is correct

    g_form.setValue cannot modify read-only fields.

  • g_form is not available in the onChange client script.

    Why it's wrong here

    g_form is available in all client script types.

  • The script runs before the new value is assigned to the field.

    Why it's wrong here

    The onChange event fires after the value changes.

About these practice questions

Courseiva writes every SNOW-CAD question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.