Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

When using "Update All" what is the view the system selects?

smaxwell
Kilo Contributor

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?

1 ACCEPTED SOLUTION

/**


* 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();


}


View solution in original post

5 REPLIES 5

Mike,



Perfect, this is exactly what I was racking my brain trying to find.



Thanks,


Scott