Collection of methods to get URL to a record.
/*
Use GlideSubstituteURL class
.generateURL(GlideRecord, Record ID)
*/
var gr = new GlideRecord('sys_user');
gr.get(gs.getUserID());| //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 |
| // This is where we'll save the attachment | |
| var tablename = 'incident'; | |
| var recordSysId = '8d6353eac0a8016400d8a125ca14fc1f'; | |
| var filename = 'snlogo.png'; | |
| // Let's download the ServiceNow Logo | |
| var logoUrl = 'https://instance.service-now.com/images/logos/logo_service-now.png'; | |
| var request = new sn_ws.RESTMessageV2(); | |
| request.setHttpMethod('get'); | |
| request.setEndpoint(logoUrl); |
| /** | |
| * @description Converts between JSON Objects and GlideRecords | |
| * @namespace | |
| * @type {Class} | |
| */ | |
| var JSONtoGlide = Class.create(); | |
| JSONtoGlide.prototype = { | |
| /** | |
| * @description Converts an object into a new GlideRecord | |
| * @param {Object} json A json object |
| export const StaticNowMap: IStaticNowMap = { | |
| // Scriptable files | |
| "SysNamesMap": { | |
| "Data Model": { | |
| "Relationships": "sys_relationship" | |
| }, | |
| "Forms & UI": { | |
| "Schedule Pages": "cmn_schedule_page", | |
| "Styles": "sys_ui_style", | |
| "Map Pages": "cmn_map_page", |
Collection of methods to get URL to a record.
/*
Use GlideSubstituteURL class
.generateURL(GlideRecord, Record ID)
*/
var gr = new GlideRecord('sys_user');
gr.get(gs.getUserID());| var OAuthGitHubHandler = Class.create(); | |
| OAuthGitHubHandler.prototype = Object.extendsObject(OAuthUtil, { | |
| // Override postprocessAccessToken method. GitHub returns a urlencoded | |
| // body, so we need to break this apart and extract the values. | |
| postprocessAccessToken: function(accessTokenResponse) { | |
| var contentType = accessTokenResponse.getContentType(); | |
| var contentBody = accessTokenResponse.getBody(); | |
| var paramMap = accessTokenResponse.getparameters(); | |
| var params = contentBody.split('&'); | |
| var parts; |
| var OAuthBitlyHandler = Class.create(); | |
| OAuthBitlyHandler.prototype = Object.extendsObject(OAuthUtil, { | |
| initialize: function() { | |
| }, | |
| interceptRequestParameters : function(requestParamMap) { | |
| // Add/Modify request parameters if needed | |
| this.preprocessAccessToken(requestParamMap); | |
| }, | |
| /* | |
| * Script include to process multiple attachments in an email through OOB Data Source process. | |
| * Attaches to existing data source, dynamically creates a schedule import entry and runs. | |
| * Processes attachments synchronously to prevent issues with multiple attachments | |
| * | |
| * Source: Fruition Partners | |
| * Author: [email protected] | |
| * Author: [email protected] | |
| */ | |
| /* | |
| Given: | |
| AD Groups: group(members) | |
| | | |
| |_a(1) | |
| | |_b(2,3) | |
| | | |_c(4) | |
| | |_d(2,5) |
| /** | |
| * Fixes issues when using "Track in Update Sets" UI action on custom scoped app table. | |
| * | |
| * Per https://community.servicenow.com/community?id=community_question&sys_id=760fb629db58dbc01dcaf3231f9619bd | |
| * a temporary table with a prefix of rep$x_ may be added to your app scope. | |
| * | |
| * As of Kingston, table columns get created in app scope but the table does not. | |
| * | |
| * @param {string} tableName | |
| */ |