Thursday, 11 April 2019

ServiceNow Application Developer Part 7



previous
_______________object
 Automatically instantiated from the GlideRecord class
 Properties are all fields from a record
 Property values are values for the record fields when they were loaded from the database and before any changes are made
 Not available in async Business Rules


 Using the Script Editor to find JavaScript syntax errors
 Examining scripts to look for errors
 Verifying the trigger is
configure correctly
Business Rule debugging before has been:


System logs, Debug Business Rules (Details),
JavaScript Debugger
Business Rule debugging strategies:


Dot-Walking
Allows direct scripting access to fields and field values on
related records


GlideSystem, GlideRecord,
GlideDataTime
Commonly used server-side APIs


GlideRecord
________________ is a server-side API that:
-is a special Java class that can be used in JavaScript exactly as if it was a native JavaScript class.
-is used for database operations instead of writing SQL queries.
-is an object that contains zero or more records from one
table


JavaScript Debugger             Primary strategy for debugging Business Rules and other                                  
synchronous server-side scripts
-Set, remote, and pause at breakpoints
-Step through code line by-line
-Step into and out of functions and method calls



-View the values of local, global, and private variables
-View the call Stack


Breakpoints
Pauses script execution to give developers the chance to
examine variables and their values


Script Includes
Reusable server-side script logic that defines a function or
class


Script Includes
____________________ execute their scripts logic only when
explicitly called by other scripts


Self-Executing
__________________ function is both declared and invoked within the same script field. Whenever writing a script that only needs to run in a single context, such as a transform map
script, use this type of function.


On demand/classes, Extend a existing class,
Define a new class
Different types of Script Includes


On Demand Script Include
-A Script Include that defines a single function
-Function is callable from other server-side scripts, can never be used client-side even if the Client callable option is selected


Extend a Script Include
Script Includes can extend existing Script Includes by
adding new methods and non-method properties


GlideAjax
Used by client-side scripts to send data to and receive
data from the ServiceNow server


GlideAjax
Client-side script passes parameters to the Script Include, which returns data as XML or JSON object. The client-side script parses data from the response and can use the data
in subsequent script logic


Service Catalog > Catalog Definition >
Record Producers
How to navigate to Record Producer


Record Producer                   A specific type of catalog item that allows end users to                                      
create task-based records, such as incident records, from



the service catalog


task records, request
item
Record producer is similar to that of a catalog item but
generates _______________ instead of a ________________


producer.url_redirect, producer.portal_redirec
t
Define the redirect link in the "Script" field:


Roles
___________ control access to features and capabilities in
applications and modules


roles
Access to modules in the Application Navigator is a
controller by __________


Group
Set of users who share a common purpose, may perform tasks such as approving change requests, resolving incidents, receiving email notifications, or performing work
order tasks


Group
Instead of individually assigning roles, assign a role to a
___________


Override application
menu roles
This option gives module-level access to a role that is not
authorized to see the application


Impersonating Users
Temporarily allows admin users to become another
authenticated user for testing purposes


Access Controls
Restrict access to data by requiring users to pass a set of requirements, defines:
What is being secured
The operation being secured
The permissions required to access the object


Access Controls
To be granted access by the _____________, a user must have
the role specified for the table


security_admin
All Access control operations (except read) require
elevated security privileges


Table/field, Requires
Role, Condition, Script
Four sections in Access Controls:


Access Control                     •Red text: An Access Control that was activated or                                      


Execution plan
deactivated
 Blue text: An Access Control that was modified
 Green test: An Access Control that is added or has become active
 Masked: An Access Control that was effective untilyou made a change
 Unmasked: An Access Control that was made effective
when you made a change


-None-
Grant access to records and all fields in the records


*
Grant access to all fields where there is no field-specific
Access Control


Best Practice: None and
*
You cannot write * Access Controls without None because only None grants access to records.

When writing an ACL that mostly grants access, use only None.

When writing an ACL that mostly denies access, use None and *.


False
True//False An ACL can't have a NONE Access Control and
a * Access Control


Name field
_____________in an Access Control specifies the table recordto protect and a field to protect, the field list has a -None-
option and a * option


System Security > Debugging > Debug
Security Rules
To enable Access Control debugging, use Application Navigator in the main ServiceNow browser window


Access Debug color
Green: Access granted

code
Red: Access denied

Blue: Does not to be re-evaluated, already in cache

Gray: Not evaluated, part of the rule has already denied

access

Check mark: Passed

X: Failed


Client-side GlideUser
-hasRole()

(g_user) API
-hasRoleExactly()

-hasRoleFromList()

-hasRoles()

Server-side
-getUser()

GlideSystem (gs) API
-getUserID()

-getUserName()

-hasRole()

-isLoggedIn()

-isInteractive()

-getSession()

canCreate(), canRead(), canWrite()
Server-side GlideElement API has methods to check whether a user's role allows them to access the associated
GlideRecord(s):


Application Settings
Determines whether an application can access resources from another application, Application designers can configure:
-Availability of cross-scope tables in Studio
-Ability for cross-scope scripts to run on application resources


Runtime Access
Tracking
Use to managed script access to resources from other
applications, also known as cross-scope access


None, Tracking,
Enforcing
Runtime Access Tracking settings:


None
No Authorization required for application scripts to access resources from other applications, no record in the cross-
scope access table


Tracking
Allows application scrips to access resources from other applications, record for the access is automatically inserted in the cross-scope access table with a Status of
Allowed (default setting).


Enforcing                            Allows application scripts to access resources from other                                                                 applications only after an admin authorizes the access,



automatically added to the cross-scope access table with


Table, Script Include,
Scriptable
Status value of Requested
Cross-scope privileges can be granted for:


Application Access Web Services
The Allow access to this table via web services option determines whether users can make inbound web services
request to the table


Allow Configuration
Allows out-of-scope applications to create application files for tables:
-Business Rules
-Client scripts
-New Fields
-UI Actions


Workflow
A sequence of activities for automating processes in
applications


Activities
_________________ are workflow blocks which perform different tasks; such as obtaining approvals, sending email, running scripts, testing conditions, and setting field values on
records


Start, End
All workflows start with a _______ activity and end execution
with an ______ activity


Triggered by field
Workflow are launched a number of different ways

values on a record, UI
including:
Action, Server-side

scripts



Graphical Workflow Editor

-Canvas tabs                                                               
-Title bar
-Workflow menu
-Workflow properties
-Start
-Validate
-Help
-Canvas
-Palette



-Workflows


checked out
-TCooprre vent developers from making changes to a workflow that will impact users, work flows need to be ________________ before they can be edited


Workflow Context
A _________ workflow's runtime environment


Checked out,
Published, Unpublished
Workflows can have three states:


checked it out
When a workflow is checked out to a user for development, that version of the workflow runs only for
the user who ______________


Document Feed
-Role Required: personalize_dictionary or admin
-A live feed group that is associated with a record, such as an incident or change


Document Feed
-Is unlisted; it does not appear when users view all groups on live feed.
-Automatically approves membership for every user who can access the record.
-Uses the record number as the group name.
-Uses the record short description as a group description.
-Maintains all messages posted to live feed on the record, if the record has a journal field for comments. If the record has a standard text field for comments, each live post overwrites the field value.
-Maintains all messages posted on the record in live feed if the record has a journal field for comments. When the group is created, existing messages are added to the
document feed.


records, tables
Live feed can be used on __________ and ___________


Live Feed Document
plugin
To use document feeds, activate the


Application Properties
Configurable application parameters for changing an
application's behavior


No
Can an application system property be a reference field?



GlideSystem getProperty()
Use Scoped ________________ method to retrieve Application Property values


Scheduled Script
Execution
Automated, server-side script logic which executes at a
specific time or on a recurring basis


Execute Now
To test a Scheduled Script Execution, use _____________________


Event
An indication in ServiceNow that something notable has occurred, can be generated by server-side scripts,
workflows, ServiceNow processes, or by user actions


Add event to the EventRegistry, Generate the vent, Create logic to
respond to the event
Generalized process for working with events is:


Event Registry
ServiceNow can only respond to events which are
registered with the ______________


-Server-side script using the gs.eventQueue() method
-Workflow Create Event
activity
There are two ways to generate events:


Event Log
Checking for events that have been generate


Email Notification,
Script Action
Two possible ways to respond to events


Record are inserted or updated, Events aregenerated, the Notification activity
executes in a workflow
Notifications send outbound email to recipients, when:


outbound email
Notifications send _____________ to recipients


when to send, who will receive, what it will
contain
Three sections to configure in a Notification:



-Email will go to expected receipients
-The Subject field resoves correctly
-The Message Body HTML field resolves correctly
Previewing notifications allows you to verify:


 current (GlideRecord API)
 email (GlideEmailOutboundAPI)
 template (TemplatePrinter API)
 event (Only for notifications responding
to events)
Script Field has access to:


Inbound Email
Mail sent from any user into ServiceNow


Inbound Email Actions
_________________enable you to define the actions an instance
takes when receiving email.


True
True//False: Can customize default homepages that
appear for each user



Content for the Homepage

 Reports                                                                    
 Gadgets
 Knowledge Base
 Labels
 System Applications
 World Clocks
 Gauges
 Catalog Categories
 Catalogs
 Diagnostics
 Live Feed



No comments:

Post a comment