Skip to content

Instantly share code, notes, and snippets.

View thisnameissoclever's full-sized avatar

Tim Woodruff thisnameissoclever

View GitHub Profile
@thisnameissoclever
thisnameissoclever / EXAMPLE - Querying Incident table from client-side script.js
Last active April 24, 2024 15:24
ServiceNow EfficientGlideRecord: A MUCH more efficient and performant client-side GlideRecord queries, as efficient as GlideAjax (or more!)
//Client-side example usage
doThing();
function doThing() {
new EfficientGlideRecord('incident')
.setLimit(10)
.addNotNullQuery('assignment_group')
.addField('number')
.addField('short_description')
.addField('assignment_group', true) //Get display value as well
@thisnameissoclever
thisnameissoclever / JournalRedactor.js
Last active April 6, 2024 08:28
Redact or delete a given journal entry in ServiceNow. Usage documentation: http://redactor.snc.guru/
/*
Script Include definition:
Name: JournalRedactor
Client Callable: false
Accessible from: All application scopes
Additional details:
Version: 1.3
Usage documentation: http://redactor.snc.guru/
License: https://gist.github.com/thisnameissoclever/767b8a738b929a0bd943965431061c1e
*/
var ClientTimeZoneUtils = Class.create();
ClientTimeZoneUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getCurrentTimeInTimeZone: function() {
var tz = this.getParameter('sysparm_tz');
var tzu = new TimeZoneUtils();
var gdt = tzu.setTimeZone(tz);
return gdt.getDisplayValue();
},