Client Scripts Questions

Implement client-side scripting for form customization and improved user experience. Master g_form, g_user, and g_list APIs for dynamic form behavior.

11 total questions2 free questions

About Client Scripts

Client Scripts run in the user's web browser and allow developers to customize form behavior dynamically. They respond to user actions like loading a form, changing a field, or submitting a record. The g_form API provides methods to manipulate form fields, while g_user gives access to the current user's information.

Why This Matters for Your Exam

Client Scripts represent 12% of the CAD exam. Questions test your knowledge of different client script types, the g_form API, and when to use client scripts vs UI policies. Understanding the client-side context and its limitations is crucial.

Key Concepts to Master

Master the four client script types: onLoad (form display), onChange (field value change), onSubmit (form submission), and onCellEdit (list editing). Know the g_form API methods for showing/hiding fields, setting values, and making fields mandatory.

Exam Tips

Remember that client scripts run in the browser so they cannot use server-side APIs like GlideRecord directly — use GlideAjax instead. Know that onChange scripts receive control, oldValue, newValue, and isLoading parameters. The isLoading parameter helps prevent unwanted execution during form load.

Practice Questions

11 questions available
1
knowledge

Which of the following is NOT one of the four types of client scripts in ServiceNow?

AonLoad
BonChange
ConBefore
DonSubmit

👆 Click an option above to select your answer

2
knowledge

Where do ServiceNow client scripts execute?

AOn the ServiceNow application server
BOn the client's web browser
COn the MID Server
DOn the database server

👆 Click an option above to select your answer