- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 06:29 PM
I am trying to determine how the system select the view to use when performing an update all or update selected from a list. The view varies from table to table so I presume this can be configured somehow.
Anyone have any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 07:06 PM
/**
* Script executed on the Client for this menu action
*
* The following variables are available to the script:
* 'g_list' the GlideList2 that the script is running against (only valid for List context menus)
* 'g_fieldName' the name of the field that the context menu is running against (only valid for List context menus)
* 'g_sysId' the sys_id of the row or form that the script is running against
* 'rowSysId' is also set to the sys_id of the row to support legacy actions, but g_sysId is preferred
*/
runContextAction();
function runContextAction() {
var url = new GlideURL(g_list.tableName + '_update.do');
url.addParam('sys_action', 'sysverb_multiple_update');
url.addParam('sysparm_multiple', 'true');
url.addParam('sysparm_nostack', 'yes');
url.addParam('sysparm_query', g_list.getQuery({fixed: true}));
url.addParam('sysparm_view', g_list.getView());
var msg = ['Update the entire list?', 'records'];
var answer = new GwtMessage().getMessages(msg);
if (!confirm(answer['Update the entire list?'] + " (" + g_list.grandTotalRows + " " + answer['records'] + ")"))
return;
window.location = url.getURL();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 06:53 PM
On a module you can define a view (ess, or leave blank for default). There is a view field you can populate. The list view will show in that view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 07:00 PM
Thanks Michael... but what I am trying to figure out is how the view is selected when I am working on a list and then choose Update All. At this point it opens a form for you to enter updates to. It is not consistent between different tables so there must be a way to set what view I wish to use for Update All / Update Selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 07:05 PM
It is a UI Context Menu: https://dev14066.service-now.com/nav_to.do?uri=sys_ui_context_menu.do?sys_id=f55ce0730a0a0b3e00a890c...
Looks like you can specify a view? Looks like it inherits the view of the list. For example:
Mobile view:
Self Service view:
Default view:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 07:06 PM
/**
* Script executed on the Client for this menu action
*
* The following variables are available to the script:
* 'g_list' the GlideList2 that the script is running against (only valid for List context menus)
* 'g_fieldName' the name of the field that the context menu is running against (only valid for List context menus)
* 'g_sysId' the sys_id of the row or form that the script is running against
* 'rowSysId' is also set to the sys_id of the row to support legacy actions, but g_sysId is preferred
*/
runContextAction();
function runContextAction() {
var url = new GlideURL(g_list.tableName + '_update.do');
url.addParam('sys_action', 'sysverb_multiple_update');
url.addParam('sysparm_multiple', 'true');
url.addParam('sysparm_nostack', 'yes');
url.addParam('sysparm_query', g_list.getQuery({fixed: true}));
url.addParam('sysparm_view', g_list.getView());
var msg = ['Update the entire list?', 'records'];
var answer = new GwtMessage().getMessages(msg);
if (!confirm(answer['Update the entire list?'] + " (" + g_list.grandTotalRows + " " + answer['records'] + ")"))
return;
window.location = url.getURL();
}