- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 10:22 PM
Hi,
I have it working when the code looks like this
function confirmApproval() {
var apprSysId = g_sysId;
g_list.action('52796e01974031105ca138200153af19', 'appr_list_context', apprSysId);
}
if (typeof window == 'undefined')
updateAndRedirect();
function updateAndRedirect() {
gs.addInfoMessage('made it!!');
}
But when I add a callback function. It doesn't work. The alert the line before works
function confirmApproval() {
var apprSysId = g_sysId;
var ga = new GlideAjax('Utils');
ga.addParam('sysparm_name', 'goAndDoSomthing');
ga.addParam('sysparm_apprSysId', apprSysId);
ga.getXML(callback);
function callback(response) {
alert('This popup works');
g_list.action('0feb2f0d8748b110245dbae8dabb358b', 'list_context_action', apprSysId);
//the action sys_id and action name above are correct and if I alert apprSysId I get the right sys_id
}
}
if (typeof window == 'undefined')
updateAndRedirect();
function updateAndRedirect() {
gs.addInfoMessage(this doesn't run');
}
Does anyone know why?
Don't thing it's a caching issue as I've created it from scratch.
Thanks Ben
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 09:49 PM
Ohh Yes, g_list will not execute server side scripts (during list context)
what's the use case here, if you still wanna show message or do some server side logic do it in script include.
something like this:
Same output:
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 09:49 PM
Ohh Yes, g_list will not execute server side scripts (during list context)
what's the use case here, if you still wanna show message or do some server side logic do it in script include.
something like this:
Same output:
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 02:02 PM
The use case is different but I can use the same method
Thanks for confirming what I thought