Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Widget API reference

Log in to subscribe to topics and get notified when content changes.

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
  • 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)
  • alert(String message).then(fn)
  • confirm(String message).then(fn)
  • open(Object options).then(fn)
  • prompt(String message, String default).then(fn)
Note: g_form as a global object cannot be used in a widget client controller or in a UI script.

Supported server side APIs

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

Class Available methods
  • 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)