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.

HOW TO REFRESH THE RELATED LIST

TejasSN_LogicX
Tera Contributor

how to refresh the specific related list using client and server script.

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@TejasSN_LogicX 

you will find lot of UI actions which work on form and refresh related list

See that and ensure you use the correct related list name

AnkurBawiskar_0-1764060930765.png

something like this

// Replace 'task_list' with the actual name of your related list
var relatedListName = 'task_list';

// Get the GlideList2 object for the related list
var gList = GlideList2.get(g_form.getTableName() + '.' + relatedListName);

// Refresh the related list
if (gList) {
    gList.setFilterAndRefresh('');
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar ,

why this  not working TejasSN_LogicX_0-1764061343408.png

 

related list 

TejasSN_LogicX_1-1764061420051.png

please help

 pls help with this

@TejasSN_LogicX 

did you check if it's going inside that IF at Line 12?

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader