Skip to content

Commit

Permalink
Added links to official documentation for method available
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebenson committed Sep 11, 2017
1 parent 5eff1da commit 2b848fe
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions documentation/widget_server_script_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@ Service Portal provides a set of convenience methods found on the global `$sp` o

| Method | Description |
| :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [canReadRecord](#canReadRecord)(Mixed, *opt String*): boolean | Returns true if the user can read the specified GlideRecord. |
| [getCatalogItem](#getCatalogItem)(String): Object | Returns a model and view model for a sc_cat_item or sc_cat_item_guide. |
| [getDisplayValue](#getDisplayValue)(String): String | Returns a display value from a field on a record in this order: <br/>1. The widget's sp_instance* record<br/>2.
| [getField](#getField)(GlideRecord, String): Object | Returns {display_value, label, type, value} for a given field on a GlideRecord. |
| [getFields](#getFields)(GlideRecord, String): Array | Like getField Checks the specified field names, and returns a comma seperated list of valid names. |
| [getFieldsObject](#getFieldsObject)(GlideRecord, String) | Checks the specified field names, and returns an object containing the valid names. |
| [getForm](#getForm)(String table, String sys_id, /*Optional String*/ encodedQuery, /*Optional String*/ view) | Returns the form|
| [getListColumns](#getListColumns)(String tableName, String view): | Returns a list of the specified table's columns in the specified view|
| [getMenuItems](#getMenuItems)(String sys_id): Array | Returns the menu items for the specified instance |
| [getMenuHREF](#getMenuHREF)(GlideRecord): String | Returns the (?id=) portion of the URL based on the sp_menu type. |
| [getParameter](#getParameter)(String): Object | Returns the value of a given key from the query string or post body. |
| [getPortalRecord](#getPortalRecord)(): GlideRecord | Returns the portal's GlideRecord. |
| [getRecord](#getRecord)(): Glide | Returns the GlideRecord for the current sp_instance\*. Returns null if the widget is embedded by another widget. |
| [getRecordDisplayValues](#getRecordDisplayValues) (Object, GlideRecord, String): void | Copies display values for the specified field names from a GlideRecord into the data parameter. |
| [getRecordElements](#getRecordElements)(Object, GlideRecord, String): void | Copies the value and display value for the specified field names from a GlideRecord into the data parameter. |
| [getRecordValues](#getRecordValues) (Object, GlideRecord, String): void | Copies values for the specified field names from a GlideRecord into the data parameter. |
| getStream(String, String): Object | Get the activity stream for a record. |
| getUserInitials() | Returns the user's initials as a string. |
| [getValue](#getValue)(String): Object | Like [getDisplayValue](#getDisplayValue) except that it returns the value instead of the display value. |
| [getValues](#getValues)(Object, String): void | Copies values from the request or instance into the data parameter. |
| [getValues](#getValues)(Object): void | Copies values from the widget's sp_instance GlideRecord into the data parameter. |
| [getWidget](#getWidget)(String, Object): Object | Returns a widget model for embedding a widget inside another widget. |
| getKBRecord(): Unkown | Not documented |
| getKBCount(): Unkown | Not documented |
| getKBCategoryArticles(): Unkown | Not documented |
| getKBTopicArticles(): Unkown | Not documented |
| getKBTopCategoryID(): Unkown | Not documented |
| getKBSiblingCategories(): Unkown | Not documented |
| [canReadRecord](#canReadRecord)(Mixed, *opt String*): boolean | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-canReadRecord_GR) Returns true if the user can read the specified GlideRecord. |
| [getCatalogItem](#getCatalogItem)(String): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getCatalogItem_S) Returns a model and view model for a sc_cat_item or sc_cat_item_guide. |
| [getDisplayValue](#getDisplayValue)(String): String | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getDisplayValue_S) Returns a display value from a field on a record in this order: <br/>1. The widget's sp_instance* record<br/>2.
| [getField](#getField)(GlideRecord, String): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getField_GR_S) Returns {display_value, label, type, value} for a given field on a GlideRecord. |
| [getFields](#getFields)(GlideRecord, String): Array | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getFields_GR_S) Like getField Checks the specified field names, and returns a comma seperated list of valid names. |
| [getFieldsObject](#getFieldsObject)(GlideRecord, String) | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getFieldsObject_GR_S) Checks the specified field names, and returns an object containing the valid names. |
| [getForm](#getForm)(String table, String sys_id, /*Optional String*/ encodedQuery, /*Optional String*/ view) | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getForm_S_S) Returns the form|
| [getListColumns](#getListColumns)(String tableName, String view): | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getListColumns_S_S) Returns a list of the specified table's columns in the specified view|
| [getMenuHREF](#getMenuHREF)(GlideRecord): String | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getMenuHREF_GR) Returns the (?id=) portion of the URL based on the sp_menu type. |
| [getMenuItems](#getMenuItems)(String sys_id): Array | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getMenuItems_S) Returns the menu items for the specified instance |
| [getParameter](#getParameter)(String): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getParameter_S) Returns the value of a given key from the query string or post body. |
| [getPortalRecord](#getPortalRecord)(): GlideRecord | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getPortalRecord) Returns the portal's GlideRecord. |
| [getRecord](#getRecord)(): Glide | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getRecord) Returns the GlideRecord for the current sp_instance\*. Returns null if the widget is embedded by another widget. |
| [getRecordDisplayValues](#getRecordDisplayValues) (Object, GlideRecord, String): void | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getRecordDispValues_O_GR_S) Copies display values for the specified field names from a GlideRecord into the data parameter. |
| [getRecordElements](#getRecordElements)(Object, GlideRecord, String): void | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getRecordElements_O_GR_S) Copies the value and display value for the specified field names from a GlideRecord into the data parameter. |
| [getRecordValues](#getRecordValues) (Object, GlideRecord, String): void | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getRecordValues_O_GR_S) Copies values for the specified field names from a GlideRecord into the data parameter. |
| getStream(String, String): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getStream_S_S) Get the activity stream for a record. |
| getUserInitials() | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getUserInitials) Returns the user's initials as a string. |
| [getValue](#getValue)(String): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getValue_S) Like [getDisplayValue](#getDisplayValue) except that it returns the value instead of the display value. |
| [getValues](#getValues)(Object, String): void | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getValues_O_S) Copies values from the request or instance into the data parameter. |
| [getValues](#getValues)(Object): void | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getValues_O_S) Copies values from the widget's sp_instance GlideRecord into the data parameter. |
| [getWidget](#getWidget)(String, Object): Object | [Official Documentation](https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GSPS-getWidget_S__O) Returns a widget model for embedding a widget inside another widget. |
| getKBRecord(): Unknown | Not documented |
| getKBCount(): Unknown | Not documented |
| getKBCategoryArticles(): Unknown | Not documented |
| getKBTopicArticles(): Unknown | Not documented |
| getKBTopCategoryID(): Unknown | Not documented |
| getKBSiblingCategories(): Unknown | Not documented |
| getSCRecord(): Object | Returns sc_cat_item record for the portal's catalog with sys_class_name != sc_cat_item_wizard and active = true in the query. GlideRecord returned has not yet triggered the query. |
| showCatalogPrices(): Unkown | Not documented |
| saveVariables(): Unkown | Not documented |
| buildThemeVariableModel(): Unkown | Not documented |
| getVariablesArray(): Unkown | Not documented |
| getWidgetFromInstance(): Unkown | Not documented |
| getRecordVariablesArray(): Unkown | Not documented |
| getFilterBreadcrumbs(): Unkown | Not documented |
| showCatalogPrices(): Unknown | Not documented |
| saveVariables(): Unknown | Not documented |
| buildThemeVariableModel(): Unknown | Not documented |
| getVariablesArray(): Unknown | Not documented |
| getWidgetFromInstance(): Unknown | Not documented |
| getRecordVariablesArray(): Unknown | Not documented |
| getFilterBreadcrumbs(): Unknown | Not documented |
| logStat(String type, String table, String id, *opt String comments*): void | Create a new entry in the `sp_log` table with a table name, a record sys_id from that name, and some type and optional comments. Handy for doing things like logging searches or visits to pages, etc. |
| getInstanceRecord(): Unkown | Not documented |
| log(): Unkown | Not documented |
| saveRecord(): Unkown | Not documented |
| logSearch(): Unkown | Not documented |
| getInstanceRecord(): Unknown | Not documented |
| log(): Unknown | Not documented |
| saveRecord(): Unknown | Not documented |
| logSearch(): Unknown | Not documented |



Expand Down

0 comments on commit 2b848fe

Please sign in to comment.