Skip to content

Instantly share code, notes, and snippets.

SNOW client-side

Client-side requests must all be made using GlideAjax with a callback function. Using .getXMLWait() is not adviced anymore since it blocks the client-side execution thread. The SNOW helper makes it possible to write the complete request as a simple one-liner.

Usage

SNOW.get(scriptInclude,functionName,sysParamObj,cb);

scriptInclde [string] The name of the ScriptInclude you are refering to.

SNOW server-side

A wrapper has been written around the standard database operation .get(), .insert(), update() and remove(). This wrapper called [Prefix]_SNOW() helps to make those request easier, more consistent and often faster to write.

Usage

var snow = new [Prefix]_SNOW();

snow.get(request);

Script documentation

When creating script-includes and other (mostly server-side) scripts try to follow these documentation guidelines. For more information about the tags check: JSDoc

Example

We take our example script from scriptIncludeCC. Documented it should look something like this:

Global logger

The global logger makes it easier to log messages using GSLog.

Usage

// Initialize the logger
var log = new [Prefix]_LOG(name);
@hawkerboy7
hawkerboy7 / Script include CC.md
Last active January 4, 2018 14:32
Script Include CC (Client Callable)

Script Include CC (Client Callable)

If you want to be able to use a client callable script include in other script includes as well, make sure you allow for the input param (in this case id) to be provided as a function argument and the GlideAjax sysparm_ input.

var SomeClass = Class.create();

SomeClass.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	type: "SomeClass",