GlideList2 (g_list) - Client
-
- UpdatedAug 1, 2024
- 7 minutes to read
- Xanadu
- API reference
The GlideList2 API provides methods to customize (v2) lists.
The variable g_list
is used to access a specified list object. The
g_list
variable is not available to the related lists form link UI action.
It is available to the lists form link UI action.
These methods are used in UI context menus and UI actions.
Several of these methods are available in Next Experience UI Framework. For details, see GlideList (Next Experience UI Framework).
GlideList2 - addFilter(String filter)
Adds a single term to the list query filter.
Name | Type | Description |
---|---|---|
filter | String | Encoded query string in standard Glide format. See Encoded query strings. |
Type | Description |
---|---|
void |
Example
GlideList2 - get(Object DOMelement)
Returns the GlideList2 object for the list that contains the specified item.
Name | Type | Description |
---|---|---|
DOMelement | Object | The DOM element ID for the list for which you want the GlideList2 object. |
Type | Description |
---|---|
Object | The GlideList2 object or null if not found. |
GlideList2 - get(String ListID)
Returns the GlideList2 object for the list specified.
Name | Type | Description |
---|---|---|
ListID | String | The list ID for which you want the GlideList2 object. |
Type | Description |
---|---|
Object | The GlideList2 object or null if not found. |
Example
GlideList2 - getChecked()
Returns a comma-separated list of the sys_ids for the items that are checked in the associated list.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | Comma-separated list of the sys_ids for the items that are checked in the list. Does not check to determine that the items returned are allowed to be executed. |
Example
GlideList2 - getFixedQuery()
Returns the fixed query.
A fixed query is the part of the query that cannot be removed from the breadcrumb (i.e., it is fixed for the user). It is specified by including a sysparm_fixed_query parameter for the application module.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The fixed query string for the list. |
Example
GlideList2 - getGroupBy()
Returns the field or comma-separated list of fields that are used to group the list.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The field or comma-separated list of fields that are used to group the list. |
Example
GlideList2 - getListName()
Returns the name of the list, which is usually the table name.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The list name (usually the table name). |
Example
GlideList2 - getOrderBy()
Returns the first field used to order the list.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The field by which to order the list. Empty if the list is not ordered. |
Example
GlideList2 - getParentTable()
Returns the name of the parent table for a related list (the table associated with the form).
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The parent table name. |
Example
GlideList2 - getQuery(Boolean orderBy, Boolean groupBy, Boolean fixed, Boolean all)
Returns the encoded query string for the list.
Type | Description |
---|---|
String | Encoded query string for the list. |
Example
GlideList2 - getRelated()
Returns the related list field that associates the related list to the parent form.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | Field that connects the list to the parent form. |
Example
GlideList2 - getTableName()
Returns the table name for the list.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | Returns the table name for the list. |
Example
GlideList2 - getView()
Returns the view used to display the list.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The name of the view. |
Example
GlideList2 - getTitle()
Returns the list title.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
String | The list title. |
Example
GlideList2 - isUserList()
Returns true if the list has been personalized by the user by choosing the list mechanic and changing the list layout.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
Boolean | True if the list layout has been changed. |
Example
GlideList2 - refresh(Number firstRow, String additionalParms)
Refreshes the list. The orderBy part of the list filter is ignored so that the list uses its natural ordering when it is refreshed.
Name | Type | Description |
---|---|---|
firstRow | Number | The first row to appear in the list. Default: First row of the current view. |
additionalParms | String | Optional name-value pairs that are submitted with the list refresh request. |
Type | Description |
---|---|
void |
Example
GlideList2 - refreshWithOrderBy(Number firstRow, String description)
Refreshes the list. The orderBy part of the list filter is included if it is specified for the list.
Name | Type | Description |
---|---|---|
firstRow | Number | The first row to appear in the list. Default: First row of the current view. |
description | String | Optional name-value pairs that are submitted with the list refresh request. |
Type | Description |
---|---|
void |
Example
GlideList2 - setFilter(String filter)
Sets the encoded query string for the list, ignoring the orderBy and groupBy parts of the query string.
Name | Type | Description |
---|---|---|
filter | String | Encoded query string in standard Glide format. See Encoded query strings. |
Type | Description |
---|---|
void |
Example
GlideList2 - setFilterAndRefresh(String filter)
Sets the encoded query string for the list, including the orderBy and groupBy if specified, and then refreshes the list using the new filter.
Name | Type | Description |
---|---|---|
filter | String | Encoded query string. |
Type | Description |
---|---|
void |
Example
GlideList2 - setFirstRow(Number rowNum)
Sets the first row that appears in the list when the list is refreshed.
Name | Type | Description |
---|---|---|
rowNum | Number | Row number of the first row to display. |
Type | Description |
---|---|
void |
Example
GlideList2 - setGroupBy(String groupBy)
Sets the list groupBy criteria for a single field.
Name | Type | Description |
---|---|---|
groupBy | String | The groupBy criteria for the list. |
Type | Description |
---|---|
void |
Example
GlideList2 - setOrderBy(String orderBy)
Sets the orderBy criteria for the list.
For
a single order by field, use orderBy field or
orderByDesc field. For multiple fields,
use orderByField1^orderByField2^orderByField3
.
orderBy specifies ascending order and orderByDesc specifies
descending. These prefix strings are optional. If not specified,
orderBy is the default order.
Name | Type | Description |
---|---|---|
orderBy | String | Single or multiple orderBy fields. |
Type | Description |
---|---|
void |
Example
GlideList2 - setRowsPerPage(Number rows)
Sets the number of rows per page to display.
Name | Type | Description |
---|---|---|
rows | Number | The number of rows to display. |
Type | Description |
---|---|
void |
Example
GlideList2 - showHideGroups(Boolean showFlag)
Shows or hides all the groups within the list and saves the current collapsed/expanded state of the groups as a user preference.
Name | Type | Description |
---|---|---|
showFlag | Boolean | If true, shows the groups within the list. |
Type | Description |
---|---|
void |
Example
GlideList2 - showHideList(Boolean showFlag)
Displays or hides the list and saves the current collapsed/expanded state of the list as a user preference.
Name | Type | Description |
---|---|---|
showFlag | Boolean | If true, displays the list. |
Type | Description |
---|---|
void |
Example
GlideList2 - sort(String field)
Sorts the list in ascending order and sets the field as an orderBy column.
Name | Type | Description |
---|---|---|
field | String | Field to use to sort the list. |
Type | Description |
---|---|
void |
Example
GlideList2 - sortDescending(String field, Number amount)
Sorts a single field in the list in descending order and sets the field as an orderByDescField column.
Name | Type | Description |
---|---|---|
field | String | Field to use to sort the list. |
Type | Description |
---|---|
void |
Example
GlideList2 - toggleList()
Toggles the display of the list and saves the current collapsed/expanded state of the list as a user preference.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
void |
Example
GlideList2 - toggleListNoPref()
Toggles the display of the list but does not save the current collapsed/expanded state of the list as a user preference.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
void |
Example
On this page
- GlideList2 - addFilter(String filter)
- GlideList2 - get(Object DOMelement)
- GlideList2 - get(String ListID)
- GlideList2 - getChecked()
- GlideList2 - getFixedQuery()
- GlideList2 - getGroupBy()
- GlideList2 - getListName()
- GlideList2 - getOrderBy()
- GlideList2 - getParentTable()
- GlideList2 - getQuery(Boolean orderBy, Boolean groupBy, Boolean fixed, Boolean all)
- GlideList2 - getRelated()
- GlideList2 - getTableName()
- GlideList2 - getView()
- GlideList2 - getTitle()
- GlideList2 - isUserList()
- GlideList2 - refresh(Number firstRow, String additionalParms)
- GlideList2 - refreshWithOrderBy(Number firstRow, String description)
- GlideList2 - setFilter(String filter)
- GlideList2 - setFilterAndRefresh(String filter)
- GlideList2 - setFirstRow(Number rowNum)
- GlideList2 - setGroupBy(String groupBy)
- GlideList2 - setOrderBy(String orderBy)
- GlideList2 - setRowsPerPage(Number rows)
- GlideList2 - showHideGroups(Boolean showFlag)
- GlideList2 - showHideList(Boolean showFlag)
- GlideList2 - sort(String field)
- GlideList2 - sortDescending(String field, Number amount)
- GlideList2 - toggleList()
- GlideList2 - toggleListNoPref()