Table of Contents
Welcome to our JAVASCRIPT PAGE Section T
Table Copy
cpTable('cmn_cost_center', 'u_cmn_cost_center_name', true); //first is table to clone name, second is name of new table wanted, third leave true to copy all indexes function cpTable(strOldTable, strNewTable, bCopyIndexes) { var tu = new TableUtils(strNewTable); var bNewTableAlreadyExists = tu.tableExists(); if (bNewTableAlreadyExists) { gs.print("WARNING: Target Table " + strNewTable + " already exists! Please choose a new target table name"); } else { var gr = new GlideRecord(strOldTable); gr.initialize(); var td = GlideTableDescriptor.get(strOldTable); var tdNewTable = new SNC.TableRotationBootstrap(strNewTable, gr.getLabel()); var dbo = new GlideRecord("sys_db_object"); dbo.addEncodedQuery("super_classISNOTEMPTY^name=" + strOldTable); dbo.setLimit(1); dbo.query(); if (dbo.next()) { tdNewTable.setExtends(dbo.super_class.name + ''); } tdNewTable.setFields(gr); tdNewTable.copyAttributes(td); tdNewTable.create(); if (bCopyIndexes) { tdNewTable.copyIndexes(strOldTable, strNewTable); } } }
Tables
- Takeaway
ServiceNow is based on a Relational Database. It is important to know that a user with the Admin role can view the Dictionary information of every field on a form by right clicking on the field label. A Schema Map tool allows you to see a diagram of relationships between tables. Some of the terminology to be aware of is as follows… A Dictionary Name is a unique term that the system uses to identify a column in the system dictionary; example: sys_user.created_on. A Core table is a base ServiceNow table. A Custom table is one that is created by a System Administrator or Developer. A Parent Class is a table that is extended by a Child Class (table). Every record in ServiceNow may be identified by a globally unique 32 character ID called a sys_id. A sys_id of -1 indicates a brand new record which has not yet been saved to the database.
- Modules
Tables & Columns - Schema Map
The Tables Table (Table of Tables) is called sys_db_object - ServiceNow is based on a Relational Database. A relational database stores data values, and their relationships, in tables. - Important! Hidden Feature: Users with the Admin role can view the Dictionary information of every field by right clicking on the field label. - Columns - Each Field on a form corresponds to a Column on a table. - Dictionary Name - A unique term that the system uses to identify a column in the system dictionary. Example: sys_user.created_on - Table Export and Import / Deploy Tables / Deploy a Table / Deploying Table - In order to export a Table from one Instance of ServiceNow to another, by hand, various objects must be captured / included. - Note however, that there is a Related Link on the sys_db_object table called “Add to Update Set” which AUTOMATICALLY adds all the related objects to an update set! - Steps… On the Source System…
- Navigate to System Definition - Tables (that's table sys_db_object)
- Filter the table so that ONLY records for the table you care about are listed (use Label or Name columns). - Use any column menu to do an Export - XML operation. - Navigate to System Definition - Dictionary (that's table sys_dictionary) - Filter the table so that ONLY records for the table you care about are listed (use the Table column to do so). - Use any column menu to do an Export - XML operation. - Navigate to System Security - Access Control (ACL) (that's table sys_security_acl) - Filter the table so that ONLY records for the table you care about are listed (use the Name column to do so). - Use any column menu to do an Export - XML operation. - Navigate to the list view sys_security_acl_role.list (Access Roles) - Filter the table so that ONLY records for the table you care about are listed. (use “Sys security acl” column to do so.) - Use any column menu to do an Export - XML operation. On the Target instance… - Elevate Roles! - From Any column menu, choose Import - XML - For Each File 1 - 4 that you previously exported, in numeric order… Choose the File and Upload it. - Navigate to each of the tables from 1 - 4, and verify that the objects exist on the target system.
- Extension - Extending a Base table with a Child table DOES maintain business logic. Existing business rules are run for child tables. A rule on the Task table affects Incident, Problem, and Change. Extending a base table incorporates all the functionality of the original table including fields and scripts. If you do not want a parent table's business rule to run for child tables, you must update the existing business rule associated with the parent table, to check for the relevant table name. Example:
if (current.getTableName() == "original_table_name")…
- Fields Individual values are known as fields. Each field is contained within a single column in a table. (Columns are sometimes also referred to as fields.) - Child Class - A table that “Extends” another table, called the “Parent Class”. For example “Task” is extended by Incident, Problem, and Change Request. - A table that does NOT extend another table is known as a “Base Class”. - Core Table - A tables in the base ServiceNow system. - Custom Table - A tables created by a System Administrator. - Display field / Display column / Display = True / Display=True In testing, the display column worked as follows: No Display Value set to “True” in Reference Table & no field called “name” –> rel table shows sys_id values. No Display Value set to “True” in Reference Table & there is a field called “name” –> rel table shows name values. Any String column has Display Value set to “True” in Reference Table –> rel table shows the value from the String column. - Reference Field - A field obtained from a related table. - Roles - When creating tables in scoped applications, a role must be assigned to the table. This is done on the “Controls” section of the table record. - By default, only users with the table's role can create, read, update, or delete table records. - Schema Map - In the Application Navigator, go to “Tables and Columns” and then click the “Schema Map” button to see a diagram of relationships between tables. - sys_id * - Records are identified by a 32 character globally unique ID called a sys_id. - A sys_id of -1 indicates a brand new record, not yet saved to the database. - From any List, you can right click on a record and do “copy sys_id”, even though the Sys Id is not displayed as a column! - Some people may refer to a sys_id as a SID (System Identifier). - Table A collection of records (rows) in the database. - zMisc - All tables in ServiceNow have a “default” list and form. - The table prefix “cmn” means “common” and indicates that a table is used in many different contexts. - The table prefix “sys” is for system access. These are Necessary for an application to function.
Tables & Columns
- Modules
System Definition - Tables & Columns - [Table]
System Definition - Tables & Columns - [Table] - Schema Map
- Allows you to see all of the Tables in the system, and for each table, the Columns within it. For each column, you can see all of the properties such as the Type, Type Description, and Max Length.
- This is also where you may create a Text Index for each field in the table. (But you can not see the existing indexes here.)
- The Schema Map button brings up the Schema Map graphical relationship tool, for the selected table.
- The Schema Map provides a graphical representation of other tables, as they relate to a given table. - For some tables which are highly connected, such as the sys_user table, the schema map may take a very long time to load. - Tables created by developers or admins are called Custom Tables. - Learning Exercise: - Created new table by extending an existing table. I believe when this is done, a corresponding “Application Menu”, Form, and Module are also created. - Configured default form and added some new fields and some fields from related tables. - Changed the title of the Module which was created automatically. - If a custom table is created within the global application, its name is prefixed with a “u_” - When you extend a table, and thus have a parent table and a child table, when you create records in the child, they are shown in the parent (with only the fields the parent has defined). If you delete the record in either the parent or the child, it disappears from both the parent and the child. - Creating a record in a parent table does nothing in the child tables; no record will appear there. - You cannot rename an actual table column after it is created. You can give it a different label, however.
Tasks
- Takeaway - A Task is a unit of work, assigned to a Group or a User. Tasks represent manual work that needs to be done, and that is being tracked in ServiceNow. Tasks include Incidents, Problems, and Change Requests. Every task has a due date, a status, and a responsible User or Group. Assignment Rules can be used to automatically assign Tasks to the appropriate groups. Tasks assigned to your assignment groups may be found under Service Desk - My Groups Work. Modules Service Desk - My Groups Work
System Policy - Rules - Assignment
- A Task is a unit of work assigned to a group or user. - Tasks are how manual work is handled in ServiceNow. Tasks are assigned to users, or groups of users. - Tasks include Incidents, Problems, Change Requests, and more. - Most tasks have things in common such as: - Due date - Status - Responsible group - Responsible user - (required approvals) - Service Level Agreement (SLA) - Approval Rules automatically apply approval tasks to a list of approvers. - Inactivity monitors ensure that tasks do not fall by the wayside, by notifying users when tasks have been untouched for a predefined time period. - A task can be assigned to an Assignment Group or to a specific User. - Assignment Rules - Automatically assign tasks to users or groups, ensuring that tasks are handled by the most appropriate team members. Example: Automatically assign incidents with a category of Hardware to Winnie Reich in the hardware group. - Assignment rules have an order value which dictates which rule has a chance to run first. Order values apply to each Category / Subcategory pairing. - When a task is routed to an assignment group that you are a part of, it may be found under Service Desk - My Groups Work. - The “User Presence” feature allows you to see who is online, their status, and what they are viewing. It facilitates synchronous collaboration.
Team Development
- Allows you to setup a distributed Version Control System between 2 or more ServiceNow instances. - Each instance acts as a Source Repository or Branch. - The Shared Parent instance acts as the central hub / repository, and all peer instances synchronize to it. - Pushing to the Parent creates a local update set on the parent that is marked as “Complete”. - Works best when each development team has access to a dedicated development instance. - Requires developers to manually merge colliding changes. - Update Sets are still used to move code to Test / Prod.
Technology Partner Program (TPP)
- Takeaway - A program called the Technology Partner Program allows ServiceNow Application Vendors to get 2 ServiceNow Instances to use in the development of Applications. Applications must be certified before they may be sold on the ServiceNow Store. Certification can take 4 to 6 weeks. A Certification Self-Test Tool is available to help an Application Author get a head start by running automated certification tests. - For Application Vendors. - Enables companies to build, test, certify, and distribute Apps and Integrations for the ServiceNow Platform. - Designed for Independent Software Vendors, System Integrators, and other Developers. - Multi-Tiered Global Program. - Allows early (6 week) access to new releases. - Provides TWO ServiceNow instances. - Partners can publish an app from one vendor instance to another, to simulate the experience of a customer downloading the app from the store. - Document Object Model (DOM) manipulation should be avoided in ServiceNow development, as it can impact Supportability and Upgradability. - Vendor Instance
- Allows publishing to the Store.
- Has the naming convention venXXXXX as opposed to devXXXXX.
- Permanent as long as you are a member of the Technology Partner Program.
- Used for development and testing of Scoped Applications.
- Certification
- To list an application on the ServiceNow Store, you must go through the application certification process.
- The certification team will inspect your application code, installation, and architecture to ensure that best practices have been followed.
- Covers Platform Stability and Performance, and Security.
- Certification can take 4 to 6 weeks.
- Certification Self-Test Tool - Allows partners to run a subset of the automated certification tests against their application before submitting for certification.
- Should help an application author get a very good idea of where he stands with regard to the certification process.
- Available under Certification Self-Test Tool - Getting Started
Test Management 2.0
- Takeaway - A Test in Test Management 2.0 is a collection of manual steps to perform, to determine whether or not a program feature is working correctly. A Test Plan defines a timeframe for testing, and is broken up into Test Cycles. A Test Cycle is a testing effort with a start and end date. A Test Execution Suite is a mechanism for assigning tests to testers, and it can be used independently of a Test Plan or Test Cycle. A Test Run is a report of test results, including a start and end time, the environment tested, and the results (pass or fail). - For Manual testing. - Two categories of testing in TM2.0 are Sprint Testing (which requires Agile Development 2.0) and General Testing, which does not. - Test - A collection of steps, used to determine whether a feature is working correctly. Includes an expected result which determines if the test passes or fails. - Test Set - A collection of related tests. - A test can fall into (be assigned to) multiple test sets. - Test Plan - Defines the timeframe for testing. Helps a Test Manger structure how a product should be tested. Generally used for large testing efforts. - Test Cycle - A testing effort with a start and end date, which is part of a test plan. - Test Run - A report of test results including start and end time, environment, and results. - Test Execution Suite - A mechanism for assigning tests to testers. Can be used in place of a formal Test Plan and Test Cycles! - Best Practices
- Create a Test for every customization.
- One Enhancement should be associated with 1 or more stories. You should not have multiple Enhancements for 1 story.
Text Indexes
- Tables
ts_index_name
sysevent - Index Table ts_index_name - Shows number of “Unique terms”, number of times queried, and “Last indexing duration”. - Scheduled Job which performs the text indexing: - Name: “text index events process” - Runs every 30 seconds by default.
- History (event) table - sysevent - Use this to make sure tables are getting indexed. Name is “text_index”. - The table should contain recently created rows, and the Processed column should not be blank. - Example to see the text index updates for the Incident table:
Example
- Inserting a brand new record into a table may Trigger text indexing to happen for all the records in that table. Saw this once for the Incident table.
Time Zone
- There is a system wide time zone. - Each user has a time zone set in his user record, which initially comes form the system time zone. - The Gear / Settings icon may be used to override the user record time zone for the current web browser session only. When the user logs back in, his time zone will be reset to whatever is in his user record.
To Do-ToDo
- I probably at some point need to define what I DO NOT DO. Where do I draw the line on what I will learn? For example, should I say that I am NOT a UI Component Builder? - Spend time researching the resources in the Customer Success Center. - Take the time to at many of the System Properties. There are 1,600 or so. - Geoff: Get a more powerful code editor integrated into ServiceNow / Chrome. - Read the entire “User Guide - All Help” document. Possible? - Really learn the APIs as much as possible. - ITIL Foundations Certification? - Figure out how to actually get something published to the Store. - Platform - Look through all the System Properties to familiarize myself with them. There are 1,600 or so. - Become familiar with these: Baseline Widgets - Learn a lot more about what APIs / Objects are available in Server Side Script. - Retake Developer training courses.
Tokyo Features
- JavaScript Versions:
https://www.w3schools.com/js/js_versions.asp
- New version of JavaScript (JavaScript Version) Old (San Diego) Version - JS 2009 / ECMA Script 5 - https://www.w3schools.com/js/js_es5.asp Tokyo - ECMA Script 2021 - ES6 - ES12 Only for Scoped Applications for now. JavaScript Mode is set at the Application level.
let const arrow functions template strings / literals map objects
- ITSM Features
- Admin Center
- Strategic & Tactical Administration
- Apps ready to Update
- Security Notifications
- Adoption Blueprints
- Service Operations Workspace (SOW)
- DevOps Config
Training Completed
11/24/2019 - Created personal ServiceNow account. Watched 31 ServiceNow Foundations videos. 02/01/2019 - Completed the ServiceNow Fundamentals on-demand course! 02/11/2020 - Earned the ServiceNow System Administrator certification! 02/12/2020 - Downloaded and read the “Success Playbook” “Avoid Customization Pitfalls so you can innovate and meet demand at scale”. 02/13/2020 - Completed the “Increase your knowledge of ServiceNow foundations” “Milestone”. Brushed up on “Application Menus” and Form Creation / Layout, Business Rules, Responsive Dashboards, Record Producers, and Workflows. 02/14/2020 - Sent resume to top 8 ServiceNow partners. Created spreadsheet to better understand “Super Badges” & overlap between role swim lanes. 02/15/2020 - Scanned/Read through about 200 jobs on the ServiceNow website. Applied for 4 jobs so far. Created “JobsAtServiceNow” document. 02/16/2020 - Created new ServiceNow Developer Instance and started “New to ServiceNow” learning plan within developer.servicenow.com. 02/17/2020 - Completed the PDI - Learning Plan - “New to ServiceNow” - “Build the NeedIt Application Module” activities. 02/22/2020 - Completed the PDI - Learning Plan - “New to ServiceNow” - “Server-Side Scripting” 02/23/2020 - Did a thorough analysis of the various ServiceNow certifications and “learning paths” and courses. Documented in “SN_Learning_Nightmare.xlsx”. Determined that most (maybe all) “Micro-Certifications” are only available to Employees, Partners, or Customers. 23/24/2020 - More PDI - Learning Plan Training. 23/25/2020 - More PDI - Learning Plan Training. Created matrix of PID Learning modules. Completed 2 hour Performance Analytics Essentials course. Took 15 question Micro-Certification assessment test. Got my first micro-certification!! 02/26/2020 - More PDI - Learning Plan Training. Workflows. Earned the micro-certification - Agile and Test Management Implementation. 02/27/2020 - Completed the “Using the Flow Designer” module. 02/28/2020 - Completed the IntegrationHub training and. Earned the micro-certification for IntegrationHub! 02/29/2020 - Completed the Flow Designer course and micro-certification. 03/01/2020 - Signed up for ServiceNow Platform Implementation virtual instructor led course. $2,400. 03/02/2020 - Completed revising 65 pages of notes. Completed 1 more Developer Portal lesson. 03/03/2020 - Put together document showing all ServiceNow Products, Certifications, Micro-Certifications, and Resume. Got Webcam working. 03/04/2020 - Started Automated Testing Framework (ATF) Micro-Certification course. 03/05/2020 - Completed Automated Testing Framework (ATF) Micro-Certification course. 03/06/2020 - Completed the “Configuring Human Resources (HR) Integrations course. 03/06/2020 - Worked on the HR Integrations learning module and the Developer ATF training module. 03/07/2020 - Completed the Developer ATF training module. Passed the HR Integrations micro-certification! 03/10/2020 - Completed the Lifecycle Events / Enterprise Onboarding and Transitions micro-certification! Met with a recruiter. 03/14/2020 - Completed the Predictive Intelligence micro-certification. 03/16/2020 - Read module 1 of the Platform Implementation course. 03/17/2020 - Completed studying ServiceNow Implementation Methodology, in preparation for ServiceNow Platform Implementation course. 03/18/2020 - Completed Platform Implementation instructor-led course - Day 1/3. 03/19/2020 - Completed Platform Implementation instructor-led course - Day 2/3. 03/20/2020 - Completed Platform Implementation instructor-led course - Day 3/3. 03/22/2020 - Studied Application Portfolio Management 03/23/2020 - Obtained Application Portfolio Management micro-certification. 03/24/2020 - Completed the Developer module “Application Properties”. 03/25/2020 - Started the “Notifications” developer module. 03/26/2020 - Completed the “Notifications” developer module. 03/27/2020 - Completed Context-Sensitive help developer module. 03/28/2020 - Completed Domain Separation developer module. Took Orlando Delta exam. Posted article about this. Started Data Visualizations module. 03/30/2020 - Completed Orlando Delta Exam. 03/31/2020 - Completed Data Visualization developer module. Created LinkedIn profile. 04/01/2020 - Completed REST Inbound and REST Outbound developer modules! 04/02/2020 - Completed the IntegrationHub developer module. 04/03/2020 - Completed the Scripted REST API developer module. 04/04/2020 - Completed the Virtual Assistant developer module. 04/05/2020 - Completed the Developing for Flow Designer developer module. 04/06/2020 - Completed the Decision Tables developer module. 04/08/2020 - Completed Performance Analytics Developer Module. Completed the “Technology Partner Program” “Learning Plan”. 04/09/2020 - Completed the Service Portal Developer Module. 04/11/2020 - Started Creating Custom Widgets Developer Module. 04/12/2020 - Completed Creating Custom Widgets Developer Module! 04/13/2020 - Completed Source Control Developer Module. 04/15/2020 - Started the Mobile Applications Developer Module. 04/16/2020 - Completed the Mobile Applications Developer Module! 04/19/2020 - Redid my Learning and Certification document in a Q&A format. 04/21/2020 - Summarized 25 pages of notes, adding a “Takeaway” section. 04/22/2020 - Summarized another 25 pages of notes, adding a “Takeaway” section. 04/23/2020 - Summarized another 25 pages of notes. 04/28/2020 - Summarized about another 25 pages of notes. 04/29/2020 - Completed “ServiceNow_Knowledge” Summarization. Read this document: ebk-now-platform-reference-guide.pdf 05/01/2020 - Completed CodeCademy Introduction to JavaScript lessons 1 and 2 (of 14). 05/02/2020 - Completed CodeCademy Introduction to JavaScript lessons 3 - 6. 05/03/2020 - Completed CodeCademy Introduction to JavaScript lessons 7 and 8. 05/04/2020 - Completed CodeCademy Introduction to JavaScript lessons 9 and 10. 05/05/2020 - Completed CodeCademy Introduction to JavaScript lessons 11, 12, and 13. 05/07/2020 - Completed CodeCademy Introduction to JavaScript lesson 14! All done! 05/08/2020 - Read JavaScript primer document.
Trust Store
- Contains certificates from other parties that you expect to communicate with. - A place (store) used to house those certificates, from a CA, that the endpoint trusts. - Used to verify credentials provided by others. - A password protected file that sits on the same file system as a running application.
TimeStampLog
- In folder “GeoffCustomLogging”, - See file “ServiceNow_Knowledge_Logging.docx” for a complete example of how to log messages ORDERED down to the Millisecond.