One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| // opens a new u_error_reporting record from an sc_task record | |
| function openOverlay(overlayID, overlayTitle, iframeURI, height, width) { | |
| // Instantiate the GlideOverlay | |
| // Note: GlideOverlay extends GlideBox, which contains the close() method | |
| var overlayWindow = new GlideOverlay({ | |
| id: overlayID, | |
| title: overlayTitle, | |
| iframe: iframeURI, | |
| allowOverflowX: true, | |
| closeOnEscape: true, |
| <?xml version="1.0" encoding="utf-8" ?> | |
| <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
| <script> | |
| document.writeln("Prototype.Version: " + Prototype.Version + "<br />"); | |
| document.writeln("Lets look at Global in ServiceNow: <br />"); | |
| myGlobal = this; |
| //Print Information about Fields in ServiceNow | |
| (function() { | |
| var grSection = new GlideRecord('sys_ui_section'); | |
| grSection.query(); | |
| while (grSection.next()) { | |
| var grSectionElement = new GlideRecord('sys_ui_element'); | |
| grSectionElement.addQuery('sys_ui_section',grSection.sys_id); | |
| grSectionElement.OrderBy('position'); | |
| grSectionElement.query(); | |
| while (grSectionElement.next()) { |
| var response = s.post(); | |
| var xmldoc = new XMLDocument(response, true); | |
| var nodelist = xmldoc.getNodes("//Action/*"); | |
| for(var i=0;i<nodelist.getLength();i++){ | |
| gs.print(nodelist.item(i).getNodeName() +' : '+nodelist.item(i).getLastChild().getNodeValue()+'\n'); |
This script uses GlideAggregate to search a field on a table for duplicate values. It then returns the value with duplicates in an array.
var xx = new GlideAggregate('table');
xx.addAggregate('COUNT', 'field');
xx.addHaving('COUNT', 'field', '>', '1');
xx.query();
var answer = []; | <?xml version="1.0" encoding="utf-8" ?> | |
| <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
| <g:requires name="angular-min.1.3.16.jsdbx" /> | |
| <link href="3ca86ab937380a006215d68543990ef6.cssdbx" rel="stylesheet" type="text/css"></link> | |
| <g2:evaluate var="jvar_stamp"> | |
| var gr = new GlideRecord('sys_ui_script'); | |
| gr.get("13a5ea4d37300a006215d68543990e41"); | |
| gr.getValue('sys_updated_on'); | |
| </g2:evaluate> | |
| <g:requires name="cs-dashboard-script.jsdbx" params="cache=$[jvar_stamp]" /> |
| //Stick this in a background script and use to search scripts anywhere in the system. | |
| var term = "search,terms"; //use comma to separate terms | |
| var useAndQuery = true; //search for term 1 and term 2. If false, it will look for term 1 or term 2. | |
| var debug = false; //set this true if you want to troubleshoot the script. | |
| var delimiter = ","; //if you want to split terms on something other than a comma | |
| var globalScriptSearch = { | |
| search: null, | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <j:jelly xmlns:j="jelly:core" xmlns:g="glide" xmlns:g2="null" xmlns:j2="null" trim="false"> | |
| <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js" /> | |
| <!-- Don't include bootstrap or jquery--> | |
| <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/r/bs/pdfmake-0.1.18,dt-1.10.9,b-1.0.3,b-html5-1.0.3,b-print-1.0.3,r-1.0.7,sc-1.3.0/datatables.min.css" /> | |
| <script type="text/javascript" src="https://cdn.datatables.net/r/bs/pdfmake-0.1.18,dt-1.10.9,b-1.0.3,b-html5-1.0.3,b-print-1.0.3,r-1.0.7,sc-1.3.0/datatables.min.js" /> | |
| <div class="container" id="container" ng-app="myApp"> | |
| <h4>My Incidents</h4> | |
| <table class="table display nowrap" id="incidents" ng-controller="IncidentController" cellspacing="0" width="100%"> |
| var UP3PDF = Class.create(); | |
| UP3PDF.prototype = Object.extendsObject(AbstractAjaxProcessor, { | |
| _document : null, | |
| createPDF : function(html, table, sys_id, filename) { | |
| var pdfDoc = new GeneralPDF.Document(null, null, null, null, null, null); | |
| this._document = new GeneralPDF(pdfDoc); | |
| this._document.startHTMLParser(); | |
| this._document.addHTML(html); |