his post comes in response to a forum question about how to reload a form or related list from a client script. This can come in extremely handy in the right situation. In the past, I’ve used scripts like these to refresh information on the form in response to a back-end server update of some sort. Here are a couple of code examples that show how to trigger these reload actions.

Reload a form

Reloading a form is simple, and it’s already built-in with the ‘Reload form’ context menu action.
Reload Form Action

The client script to reload a form looks like this…


Refresh a related list

Refreshing a related list is a bit more complex since you need to correctly identify the related list you wish to refresh. You can do that by right-clicking the related list header and selecting ‘Personalize->List Control’. The list control will show you the name of the related list that you need to use. In the screenshot below, the name of the ‘Affected CIs’ related list is ‘task_ci.task’.
List Control

Once you’ve identified the name of the related list, you can refresh it from any client-side script by using the following code (adding your list name where appropriate).

GlideList2.get(g_form.getTableName() + '.YOUR_RELATED_LIST_NAME_HERE').setFilterAndRefresh('');

So if you wanted to set up a client-side ‘Refresh’ UI action for the ‘Affected CIs’ related list, you could do so with the following setup. Notice the use of ‘task_ci.task’ to identify the related list in the ‘Script’ section.

‘Refresh’ related list UI action
Name: Refresh
Table: task_ci
Client: true
List banner button: true
Onclick: refreshAffectedCIs()
Condition: RP.isRelatedList()

function refreshAffectedCIs(){
   GlideList2.get(g_form.getTableName() + '.task_ci.task').setFilterAndRefresh('');  

Refresh an embedded related list

It’s also possible to refresh an embedded related list.

try {
      var elementLookup = $$('div.tabs2_list');
      var listName = "Affected CIs";
      for (i = 0; i != elementLookup.length; i++) {
         if (elementLookup[i].innerHTML.indexOf(listName) != -1) {
            var listHTML = elementLookup[i].id.split('_');
            var listID = listHTML[0];
catch (err) {

function nowRefresh(id) {