API Docs for: 0.6.0
Show:

CWTSCOrderGuide Class

Extends SPWidget
Defined in: penske\scratch.js:2

This is a copy of the SC Order Guide widget created to preserve modifications with the updates from upgrading the instance.

This header is used to parse this with YUIDocs for documentation creation and can be parsed with a YUIDocs documentation parser.

See the YUIDocs site for syntax or additional details; https://yui.github.io/yuidoc/

Note that only the additions performed are documented in this fashion. ServiceNow code that was not modified or used was left as is.

The modifications to this widget are summarized below for future considerations:

  • Displaying the "For" and "At" in the top right corner to indicate the employee being affected and the location at which this is being considered

Future modifications should be noted above for consideration after upgrades.

Methods

getEmployeeName

() String

Retrieves the employee name from the glide form using the "getDisplayValue" method and parses the username from the string if one is determined to be present. The presence of a "-" character is used to determine this.

Due to different variables being used to store the employee depeneding on access type, the type is read and used to determine the name to use with a general fall back on various naming conventions to isolate the name in a general case should variables change.

The general fallback fails however as values are not (and likely should not) clear when the access type changes, meaning a name could become "stuck" displaying in the event the access type changes if this has not been updated with the map of "access type" to "variable used for employee name".

However it would be recommended to consolidate the usage fo variables to one variable representing the employee for any access type, and that variable is assumed to be "requested_for" in the code below, and assignment priority is given to that variable name where considerations are made.

Uses the private {{crossLink "localGlideForm"}}{{/crossLink}} value for gathering values.

Returns:

String:

The Employee name per the localized GlideForm.

getLocationName

() String

Retrieves the name of the location from the glide form using "getDisplayValue".

Uses the private {{crossLink "localGlideForm"}}{{/crossLink}} value for gathering values.

Returns:

String:

The name of the Location per the localized GlideForm.

Properties

_glideForms

Object

Mapped along side includedGformInstances but is persisted to preserve values for reference. Currently only saves the GlideForm for the data.sys_id reference.

includedGformInstances

Object private

ServiceNow variable used for mapping sys_id values to the underlying glideform.

This is updated on load, so for clarity and asynchronous timing, the values from here should be loaded in the function at time of need rather than attempting to pre-load any values.

locakedValues

Object

Maps values for display purposes that have been stored for preservation.

This is used to keep values in place after "goNext" is called to

primaryGlideForm

Object

The GlideForm for the Order Guide itself. Set after load.

waitingValue

String

Value displayed in the "For" or "At" form locations when the values are not known or while the form is loading, such as the GlideForm not yet being available.

This would otherwise result in empty displays or errors in the console if the considerations were skipped.