Script Includes Questions

Build reusable server-side JavaScript libraries with Script Includes. Learn to extend classes, create client-callable scripts, and implement the AbstractAjaxProcessor pattern.

12 total questions2 free questions

About Script Includes

Script Includes are reusable server-side JavaScript objects that are loaded on demand. They promote code reuse and maintainability by encapsulating logic in class-based structures. Client-callable Script Includes enable client-server communication through the GlideAjax framework, following the AbstractAjaxProcessor pattern.

Why This Matters for Your Exam

Script Includes account for 12% of the CAD exam. Questions focus on creating and using Script Includes, extending base classes, making Script Includes client-callable, and understanding scope implications.

Key Concepts to Master

Master the Script Include structure with initialize() and prototype patterns. Understand how to extend AbstractAjaxProcessor for client-callable Script Includes. Know the difference between scoped and global Script Includes and when each is appropriate.

Exam Tips

Remember that client-callable Script Includes must extend AbstractAjaxProcessor and have the 'Client callable' checkbox selected. The getParameter() method retrieves values passed from GlideAjax. Script Includes are loaded on demand — they don't execute until called.

Practice Questions

12 questions available
1
knowledge

What is the primary purpose of a Script Include in ServiceNow?

ATo execute client-side scripts automatically when a form loads
BTo store reusable JavaScript for execution on the server
CTo define UI Policies that dynamically control form field behavior
DTo create scheduled automation jobs that run at defined intervals

👆 Click an option above to select your answer

2
knowledge

Why is the 'current' object NOT available inside a Script Include?

AScript Includes only execute on the client side where current is not defined
BScript Includes are not associated with a specific table, so there is no current record context
CThe current object was deprecated and replaced by GlideRecord in the Yokohama release
DScript Includes can only access records through the previous object

👆 Click an option above to select your answer