Callback function not being executed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020 09:24 AM
I'm trying to use the g_modal.showFrame in a UI action to update a record then after being close run a callback function.
Kb0743790 says "callback Function will be called after modal is closed, with parameters: true if the user confirmed, and false otherwise." but my alert doesn't run after the model is closed out. What am I doing wrong?
https://hi.service-now.com/kb_view.do?sysparm_article=KB0743790
function onClick(g_form) {
var url = '/sys_user.do?' +
'&sysparm_query=sys_id=' + g_form.getValue('caller_id') +
'&sysparm_view=itil' +
'&sysparm_form_only=true';
g_modal.showFrame({
url: url,
title: 'Update User Record',
size: 'xl'}).then(function() {g_modal.alert('Check.');});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 12:28 AM
Hi,
somehow I was not able to test this out in my PDI
I created UI action with that script; it gave me this error
Uncaught ReferenceError: g_modal is not defined
Can you share how you have configured that?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2020 09:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 04:29 AM