1.0.5 • Published 1 year ago

service-portal-snippets v1.0.5

Weekly downloads
57
License
MIT
Repository
github
Last release
1 year ago

Service Portal Snippets for VS Code

This extension for Visual Studio Code adds a handy collection of ServiceNow Service Portal snippets. The snippets adhere to best practice by following the Service Portal: Style Guide.

Use Extension

See the CHANGELOG for the latest changes.

Usage

To generate a snippet, simply type part of the snippet and press enter.

HTML Snippets

SnippetPurpose
sp-ng-class-attributeng-class with attribute
sp-ng-class-cssng-class with CSS class
sp-ng-ifng-if
sp-ng-includeng-include
sp-ng-repeatng-repeat
sp-ng-repeat-combong-repeat with orderBy and track by
sp-ng-repeat-orderByng-repeat with orderBy
sp-ng-repeat-track-byng-repeat with track by
sp-modal-alertDisplays an alert
sp-modal-confirmDisplays a confirmation message
sp-modal-openOpens a modal window using options
sp-modal-promptDisplays a prompt for user input
sp-tag-embed-widgetEmbed a widget using <widget>
sp-util-embed-widgetEmbed a widget using <sp-widget>

Client Snippets

SnippetPurpose
sp-ng-broadcast$broadcast
sp-ng-controllerCreates a client controller
sp-ng-emit$emit
sp-ng-http$http
sp-ng-on$on
sp-ng-onInit$onInit
sp-modal-alertDisplays an alert
sp-modal-confirmDisplays a confirmation message
sp-modal-openOpens a modal window with embedded widget
sp-modal-promptDisplays a prompt for user input
sp-util-addErrorMessageDisplays a notification error message
sp-util-addInfoMessageDisplays a notification info message
sp-util-addTrivialMessageDisplays a trivial notification message
sp-util-getEmbed a widget in the client script
sp-util-get-optionsEmbed a widget with options
sp-util-record-watchTool to capture real-time table updates

Server Snippets

SnippetPurpose
sp-record-addActiveQueryAdds a filter to return active records
sp-record-addEncodedQueryAdds an encoded query to other queries
sp-record-createCreates a GlideRecord class for a table
sp-record-deleteMultipleDeletes multiple records
sp-record-deleteRecordDeletes the current record
sp-record-getA method used to query for single record
sp-record-getRowCountGet the number of rows for a query result
sp-record-insertInserts a new record
sp-record-setLimitThe maximum number of records to fetch
sp-record-updateUpdates the current record
sp-record-updateMultipleUpdates multiple records
sp-session-getClientIPReturns the client IP address
sp-session-getLanguageReturns the session's language code
sp-session-isLoggedInReturns true if the user is logged in
sp-user-getDisplayNameGet the current user's display name
sp-user-getEmailGet the user's email address
sp-user-getFirstNameGet the user's first name
sp-user-getIDGet the sys_id of the current user
sp-user-getLastNameGet the user's last name
sp-user-getUserNameGet the user's username
sp-user-hasRoleDetermines if a user has a specified role
sp-user-isMemberOfChecks if the user is a member of a group

UI Script Snippets

SnippetPurpose
sp-ng-componentCreates an AngularJS component
sp-ng-moduleCreates an AngularJS module
sp-ng-serviceCreates an AngularJS service

Script Includes

SnippetPurpose
sp-script-includeCreates a script include

Pro Tip

Simply type the snippet without dashes to activate IntelliSense.

License

MIT License

1.0.5

1 year ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago