Widget API reference

The following client and server side APIs are supported in the Service Portal.

Supported client side APIs

These are the supported Service Portal APIs that can be used in a widget client controller.

For detailed class and method information, see the API reference on the developer portal.

Class Available methods
spUtil
  • addInfoMessage(String message)
  • addTrivialMessage(String message)
  • get(String widgetId)
  • format(String, Object)
  • refresh(Object $scope)
  • recordWatch(Object $scope, String table, String filter, Function callback)
  • Update(Object)
spModal
  • alert(String message).then(fn)
  • confirm(String message).then(fn)
  • open(Object options).then(fn)
  • prompt(String message, String default).then(fn)

Supported server side APIs

These are the supported Service Portal APIs that can be used in a widget server script.

Class Available methods
GlideSPScriptable
  • canReadRecord(GlideRecord gr)
  • canReadRecord(String table, String sysId)
  • getCatalogItem(String sysId)
  • getCatalogItem(String sysId, Boolean isOrdering)
  • getDisplayValue(String fieldName)
  • getField(GlideRecord gr, String fieldName)
  • getFields(GlideRecord gr, String fieldNames)
  • getFieldsObject(GlideRecord gr, String fieldNames)
  • getForm(String tableName, String sysId)
  • getListColumns(String tableName, String view)
  • getMenuHREF(GlideRecord page)
  • getMenuItems(String sysId)
  • getParameter(String name)
  • getPortalRecord()
  • getRecord()
  • getRecordDisplayValues(Object data, GlideRecord from, String names)
  • getRecordElements(Object data, GlideRecord from, String names)
  • getRecordValues(Object data, GlideRecord from, String names)
  • getStream(String table, String sysId)
  • getUserInitials()
  • getValue(String name)
  • getValues(Object data, String names)
  • getWidget(String sysID, Object options)