CAD practice question 23 of 35

There is a basic strategy when creating a Utils Script Include. Identify the step that does not belong.

Full set: 264 questions
Answer options
A: Identify the table Correct answer
B: Script the function(s)
C: Create a class
D: Create a prototype object from the new class
Correct Answer:
A. Identify the table
Explanation

A utility Script Include is a general-purpose library that is not tied to any particular table. The documented procedure is:
1) define the class with Class.create();
2) build the prototype object for that class;
3) add one or more functions inside the prototype. Selecting a table is required for Business Rules, UI Policies, Table-Scoped Scripted REST APIs, etc., but plays no part in the construction of a utility Script Include. Therefore, “Identify the table” is the only step that does not belong.

Why Incorrect

B. Writing one or more functions inside the prototype provides the utilitarian behaviour; it is a required step.
C. Every Script Include begins by declaring a class with Class.create(); hence this is essential.
D. The prototype object (containing the methods and the type property) must be created; otherwise the class has no executable body.

References

1. ServiceNow Product Documentation – “Create a server-side utility Script Include”, docs.servicenow.com, Madrid-Tokyo releases: steps 1-3 (Define class, Create prototype, Add functions).

2. ServiceNow Developer Site Learning Path “Server-Side Scripting > Script Includes > Utility Script Includes”, Lesson text ¶3-¶6 describing the same three steps (no table selection mentioned).

3. ServiceNow Courseware “Scripting in ServiceNow Fundamentals”, Module 5, p. 7: checklist for utility Script Include creation (class → prototype → functions; table not applicable).

Scroll to Top