88 questions from the Application User Interface domain of the ServiceNow Certified Application Developer (CAD) exam, each with its answer and an explanation. Read them through as revision, then sit the full practice exam to test yourself on them under multiple-choice conditions.
Answer
The Add to Service Catalog related link on a table record creates a record producer for that table and generates variables from the fields you choose, so you don't have to build each variable by hand. There is no Add New Record Producer button on a category and no Create Record Producer item in the form context menu.
Answer
Record producers are Service Catalog items, so their variables are controlled in the browser by catalog client scripts and catalog UI policies. Regular client scripts and UI policies apply to table forms, and a record producer script runs on the server.
Answer
The module created with a new table is a List of Records module for that table, so it opens a list of all its records. You can change the module's link type or add a filter afterwards.
Answer
The column context menu on a list offers Bar Chart and Pie Chart, which build a quick report grouped by that column. Other types, such as histograms and line charts, are created in the report designer.
Answer
A module is an item in an application menu that does something when selected, such as opening a list, a form or a page in the content frame or a new window. The application menu is the group of modules, and filtering the navigator is a separate feature.
Answer
Normally a user must be able to see the application menu before its modules appear. With Override application menu roles selected, users who have the module's roles can see the module even without the roles required for its application menu.
Answer
g_user is available in scripts that run in the browser: client scripts, UI policy scripts and client-side UI actions. Server-side scripts such as business rules and script includes use GlideSystem methods, like gs.getUser() and gs.hasRole(), instead.
Answer
Changing an inherited field's label on a child table's form creates a label for that child table only. The parent table, and any other tables that extend it, keep their own labels.
Answer
When a UI policy's conditions are evaluated, its UI policy actions, such as making fields mandatory, visible or read-only, are applied first. Its Execute if true or Execute if false scripts run afterwards.
Answer
Assessment, List of Records, Separator and Timeline Page are all module link types, along with others such as New Record, Content Page and URL (from Arguments). Roles and Order are other fields on the module record, and Catalog Type is not a link type.
Answers
Reports can show data as charts, can be run on demand by users who are allowed to, and can be scheduled so they are emailed automatically. Sharing a report doesn't give access to data the user can't otherwise read, and access controls decide which tables a user can report on.
Answer
UI actions can appear as form buttons, form context menu items, form links, list banner buttons, list bottom buttons, list context menu items, list choices and list links. There is no form choice type.
Answer
g_form.addInfoMessage() shows an informational message, on a blue background by default, at the top of the form. g_form.showFieldMsg() shows a message under a specific field, and addInfoMsg() and showFieldMessage() are not GlideForm methods.
Answer
In a record producer script, the values the user entered are read from the producer object by variable name, for example producer.short_description. current is the record being created, so current.field_name is used to set its fields.
Answer
There is no fixed limit. An application can have as many application menus as its design needs, for example separate menus for its users and its administrators, each with its own roles.
Answer
GlideUser (g_user) runs in the browser, alongside GlideForm (g_form). current and previous, GlideSystem (gs) and workflow.scratchpad are all used in server-side scripts.
Answer
gs.log() is a server-side method and can't be called from a client script. Client scripts can be debugged with jslog(), g_form.addInfoMessage(), the Field Watcher and the browser's developer tools.
Answer
In Form Designer you drag a field from the Fields tab to add it, drag a data type from the Field Types tab to create a new field, and use a field's Delete (X) button to remove it. Sections are not added by dragging from the Field Types tab, so statement d is incorrect.
Answer
Application menus and modules have a Roles field, and only users with one of those roles see them in the Application Navigator; if the field is empty, every user can see them. Access controls secure data rather than navigation, and client scripts only run on forms.
Answer
g_form.getReference() is designed for client scripts on the standard platform UI. Service Portal is built differently, and its client scripts usually get server data with GlideAjax instead.
Answer
A record producer creates a record in whichever table it is configured for, such as Incident or a custom application table. Requested items are created by ordering catalog items, not by record producers.
Answer
Client scripts and UI policies can be limited to one form view by clearing their Global check box and choosing a view. That lets the same table behave differently on different views.
Answer
An embedded list shows related records inside the form and lets users add or edit them without leaving it; the changes are saved with the form. The first option describes an ordinary related list.
Answer
UI policy scripts work with the form's current values and have no access to earlier ones. An onChange client script receives both oldValue and newValue, so use one when you need to compare a field's previous value.
Answer
Removing a field from the form layout only takes it off that form view. The field and its data stay on the table, and it can be added back to the form at any time.
Answer
The action name is how the form identifies which UI action was clicked, so it has to be unique on the table. When two UI actions share one, the system can't tell them apart, and neither runs as intended.
Answer
In Form Designer, sections are added with the + control on an existing section, not from the Field Types tab. The field types are used to create new fields.
Answer
Form Designer only lays out forms. List columns are configured separately, with Configure > List Layout from the list's context menu.
Answers
A record producer targets one table, its variables are mapped to that table's fields, and catalog UI policies control its variables on the form. Its form is built from variables rather than rich media such as graphics and movies.
Answer
An application properties page is opened through a URL, such as system_properties_ui.do with the properties category, so the module uses the URL (from Arguments) link type. Single Record opens one record, and the other types run a script or show HTML.
Answer
There is no limit on the number of modules in an application menu. Add as many as the application needs, and use separators to keep a long menu organized.
Answer
producer is available only in the record producer's script, which runs on the server when the form is submitted. Catalog client scripts run in the browser and read variables with g_form, for example g_form.getValue('variable_name').
Answer
A record producer is opened through its URL, so the module uses the URL (from Arguments) link type with the record producer's address. The other types run a script, show HTML or open a content page.
Answer
An annotation adds instructional text directly on the form, where the user needs it, without creating a field or sending users to another page.
Answer
Client scripts run onLoad when a form opens, onChange when a field changes, onSubmit when a form is saved, and onCellEdit when a cell is edited in a list. Before, after, query and display are business rule timings.
Answer
Adding $m.do to the instance URL opens ServiceNow's mobile interface in the browser. The other paths don't open it.
Answers
A field can be made read-only through its dictionary attributes, with a client script calling g_form.setReadOnly(), or with a UI policy action. UI actions add buttons and links, and business rules run on the server, so they don't change how a field behaves on the form.
Answer
The notification sent when a dashboard is shared can be customized by administrators, including its content and recipients, like other notifications.
Answer
Function fields calculate a value for a report from other fields, using functions for arithmetic, coalesce, concatenation and length, without storing anything in the database. The other options are not report features.
Answer
The Localization Framework plugin manages translating content such as catalog items, including their names, descriptions and variables, into other languages. The other plugin names are not ServiceNow plugins.
Answer
Non-signals are KPI scores that stay within their normal statistical range rather than reacting to random fluctuations. Because they show a process is stable over time, they support decisions about long-term stability. The other options are not KPI signal types.
Answer
UI scripts load with the page first, then client scripts run, then UI policy actions are applied, and finally UI policy scripts run.
Answers
A UI action's script runs on the server by default. Selecting Client lets it run a client-side function when it is clicked, such as a confirmation before the form is submitted.
Answer
UI policies only apply on forms. A data policy is enforced whenever data is changed, including list editing, imports and web services, so it locks the fields in the list view too.
Answer
g_form is the GlideForm object, which client scripts use to read and change fields on the current form. There is no gs_form object; gs is the server-side GlideSystem object.
Answers
The values in the multi-row variable set can be copied into the multi-line text variable by an onSubmit catalog client script before the request is submitted, or by a Run Script activity in the workflow after the requested item is created. UI macros and UI actions aren't used to fill in catalog variables this way.
Answer
Setting the glide.ui.debug_ui_policy property to true shows messages about how UI policies are processed on the form, which helps find out why a policy did or didn't apply.
Answer
A UI script can be loaded on a form through a formatter whose UI macro includes a g:requires tag naming the UI script with the .jsdbx extension. Adding that formatter to the form view loads the UI script with the form.
Answer
The banner image, banner text and colors are changed on the Basic Configuration UI16 properties page, reached here through Site Settings > Properties.
Answer
A global client script operates only in the global scope. It doesn't run in scoped applications unless it belongs to that application's scope.
Answer
Applications built for the desktop interface also run on tablets, which have enough screen space for the full interface. Smartphones use the separate mobile experience.
Answer
g_scratchpad values are set by a display business rule before the form loads, and client scripts read them, typically in onLoad() to set up the form and in onChange() to react to field changes.
Answer
getXMLWait() makes the GlideAjax call synchronously, so the browser waits for the server's response and ga.getAnswer() already holds it when alert() runs. getXML() is asynchronous, so the alert can run before the answer arrives, and server-side code on its own doesn't produce a client-side alert.
Answer
g_form.getControl() returns the HTML element for the field, and setting its maxLength property limits how many characters can be typed. getField() doesn't return the element in a way that supports this.
Answer
The com.snc.pa.dc.script_timeout property sets how long a script can run during a Performance Analytics data collection, and administrators can change its value.
Answer
When Cascade variables is selected, the values entered in the order guide's variables are passed to variables with the same name on the ordered items, so users don't enter them again. When it is cleared, those values are not passed on.
Answer
Sharing a report with Everyone makes it available to every user who is logged in to the instance. Publishing gives the report a URL that reaches beyond logged-in users, so it isn't needed.
Answer
spUtil.recordWatch() registers a listener in a Service Portal widget that is notified when records in a table, optionally filtered, are inserted, updated or deleted, so the widget can refresh. recordListener() is not an spUtil method.
Answer
In Jelly, a UI macro is called with a g: tag named after the macro itself, so a macro called macro_name is included with <g:macro_name />. There is no generic ui_macro tag.
Answer
ng-if is an AngularJS directive that adds an element to the page only when its expression is true, so a widget's HTML template can use it to show the element conditionally when the page loads.
Answer
Yes. g_form.getUniqueValue() returns the sys_id of the record open on the form, and GlideAjax can return the sys_ids of other records from the server.
Answer
getFullName(), hasRole() and hasRoleExactly() are methods of the g_user object in client scripts. userNameValid() is not one of them.
Answers
Client-side code can be written in catalog UI policy and UI policy scripts, client-side UI actions, a UI page's client script and UI scripts. Business rules run on the server, although they can pass data to the client with g_scratchpad.
Answers
GlideUser (g_user) is used in client scripts and UI policies, and in UI actions that run on the client, and it provides methods for the current user's name and roles. getMyGroups() doesn't return an iterator of active and inactive groups, and the statements about every method using default session information are not accurate.
Answer
spUtil.addErrorMessage() shows an error message in a Service Portal widget, just as spUtil.addInfoMessage() shows an informational one. addErrMessage() is not an spUtil method.
Answer
Yes. Selecting Override application menu roles on a module lets users who have the module's roles see it even if they don't have the roles for its application menu.
Answer
getXML() sends the request asynchronously, so the next line runs before the server has answered and getAnswer() has no value yet. To use the answer, read it in the callback function passed to getXML().
Answer
Configure Styles, from the field label's context menu, creates field styles that change how a field's value looks, for example its color. Administrators can also manage them under System UI > Field Styles.
Answer
Break, Container Split and Container End only lay out the catalog form and hold no value, so a UI policy's Set Visible action has no effect on them.
Answer
Yes. A report that hasn't been published isn't available at its shared URL, so it has to be published before people outside the instance can open it.
Answer
The Theme Editor, Page Editor and Widget Editor are Service Portal configuration tools, used for branding, page layouts and building widgets. Designer is the option this question counts as not being one of them.
Answer
g_form.addErrorMessage() shows a message with a red background at the top of the current form, the error counterpart of addInfoMessage(). A message next to a specific field is shown with g_form.showFieldMsg().
Answer
The User [sys_user] table holds each user's last login, so the report is built on it, with one condition for a last login more than 90 days ago and another excluding group managers. sys_user_group holds groups and sys_user_grmember holds group memberships, and neither stores login dates.
Answer
AI Search Assist shows relevant knowledge articles and catalog items while a user fills in a form, such as a record producer, so they may find an answer before submitting a request. It doesn't create REST endpoints, and search profiles are set up separately in AI Search.
Answer
Trends, line charts and lists are all report types you can choose in the report designer. A chart container is a layout element that holds other components, not a type of report.
Answer
A Performance Analytics indicator can be added to a homepage as a widget that shows its scores and charts. Knowledge article tags organize articles, and service catalog items are for ordering, so neither places a report on a homepage.
Answer
g_form.showFieldMsg() shows a message directly below a specific field on the form. addInfoMessage() and addErrorMessage() show messages at the top of the form, and addFieldMessage() and showFieldMessage() are not GlideForm methods.
Answer
A metric records a measurement as records change, such as how long an incident spends in each state or assignment group, so values can be compared and reported on to judge how well workflows and SLAs are performing.
Answer
Form annotations can be text, section separators, line separators or colored info boxes, such as blue and yellow. Section Details is not an annotation type.
Answer
Landing pages for the ServiceNow Agent mobile app are configured separately from desktop homepages, using mobile-specific components, so agents get a view designed for a phone inside the app itself.
Answer
In the record producer's Script field, setting producer.redirect to a URL sends the user to that page after they submit. A business rule runs on the server and can't redirect the browser with window.redirect, and neither a property nor the module decides where the user lands after submitting.
Answer
Every module belongs to an application menu, opens content and is controlled with roles, but not every module is linked to a table. A module can open a URL, a homepage or a report instead.
Answer
Embedded help with no roles isn't limited to particular roles, but it still only appears on the page it belongs to, so it is seen by users who are authorized to use that application and page.
Answer
A custom embedded help record can require roles, so its content is shown only to users who have one of them. It can't be marked as created by ServiceNow, each record belongs to one page rather than both a list and a form, and it appears in the help panel rather than a separate browser window.
Answer
The embedded help editor has a Video button, into which you paste the HTML embed code for the video, such as the embed code a video site provides. The Link button only creates a hyperlink, and pasting a plain link into the Video button doesn't embed the video.
Answers
Embedded help shows content for the page a user is on, can be limited by role, and is used to coach users on a custom application with written or video instructions. Translating help into other languages is handled separately, and content isn't chosen by query parameter values.
Answer
Custom embedded help is optional. Developers can write help that applies to everyone, add role-specific help only where it's useful, or leave a page without custom help.
Answer
When a page has no embedded help of its own, a default embedded help page is shown instead, so users still get general guidance. The help button stays available, and users aren't sent to another site.