- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 07:58 AM
Hi, I want to refresh my REQ form automatically once the request is created as the approvers in the approval tab appears only after I refresh it manually .
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:03 AM
Here is something that I created in the past. It resided in a Client script and it was refreshing the related list of my choice. here is the script with a delay of 4 seconds. check if you can adapt this to your case.
if(!g_form.getValue('contract')){
return;
}
setTimeout(function(){
if(!g_form.isNewRecord()){
var listName =g_form.getTableName()+'.REL:70e80f390a0a0b1b0035a51d8bbfd32c';
var list = GlideList2.get(listName);
// if (list){
// g_form.addInfoMessage('List selected');
// }else{
// g_form.addInfoMessage('List not selected');
// }
var filter = 'contract='+g_form.getValue('contract')+'^end_date>=javascript:gs.beginningOfToday()^start_date<=javascript:gs.endOfToday()';
list.setFilterAndRefresh(filter);
}
}, 4000);
Please Mark Correct AND Helpful. Thanks!
Martin Ivanov
2022 Community Rising Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:03 AM
Here is something that I created in the past. It resided in a Client script and it was refreshing the related list of my choice. here is the script with a delay of 4 seconds. check if you can adapt this to your case.
if(!g_form.getValue('contract')){
return;
}
setTimeout(function(){
if(!g_form.isNewRecord()){
var listName =g_form.getTableName()+'.REL:70e80f390a0a0b1b0035a51d8bbfd32c';
var list = GlideList2.get(listName);
// if (list){
// g_form.addInfoMessage('List selected');
// }else{
// g_form.addInfoMessage('List not selected');
// }
var filter = 'contract='+g_form.getValue('contract')+'^end_date>=javascript:gs.beginningOfToday()^start_date<=javascript:gs.endOfToday()';
list.setFilterAndRefresh(filter);
}
}, 4000);
Please Mark Correct AND Helpful. Thanks!
Martin Ivanov
2022 Community Rising Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:04 AM
with the GlideList2 api you have some method that can help you refresh only the related lists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 12:17 PM
Hi. If your issue is resolved and my response has helped, plese consider marking Correct and Helpful. Thanks!
Martin Ivanov
2022 Community Rising Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 04:20 AM
Hi. Thanks for marking correct, but please mark the original response, as it might help some other people.