
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 06:52 AM
Hi guys, i have glide ajax script and it works fine, but I have a problem with reloading form from script include, or in ui action but after glide ajax finished, how is it possible?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 07:59 AM
Hi,
can you try this
// ui action
function moveToCloseState() {
var sys_id = g_form.getUniqueValue();
var ga = new GlideAjax('incident');
ga.addParam('sysparm_name', 'setCloseState');
ga.addParam('sysparm_id', sys_id);
ga.getXML();
var url = '/' + g_form.getTableName() + '.do?sys_id=' + sys_id;
top.location.href = url;
}
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
07-21-2020 07:48 AM
Hi,
Can you share your existing UI action script; you should be able to reload
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
07-21-2020 07:56 AM
// ui action
function moveToCloseState() {
var sys_id = g_form.getUniqueValue();
var ga = new GlideAjax('incident');
ga.addParam('sysparm_name', 'setCloseState');
ga.addParam('sysparm_id', sys_id);
ga.getXML();
}
//Script include
var CloseInc = Class.create();
CloseInc.prototype = Object.extendsObject(AbstractAjaxProcessor, {
setCloseState: function() {
var sys_id = this.getParameter('sysparm_id');
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', sys_id);
inc.query();
if (inc.next()) {
inc.state = '7';
inc.update();
}
},
type: 'CloseInc'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 07:59 AM
Hi,
can you try this
// ui action
function moveToCloseState() {
var sys_id = g_form.getUniqueValue();
var ga = new GlideAjax('incident');
ga.addParam('sysparm_name', 'setCloseState');
ga.addParam('sysparm_id', sys_id);
ga.getXML();
var url = '/' + g_form.getTableName() + '.do?sys_id=' + sys_id;
top.location.href = url;
}
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
07-21-2020 08:03 AM
Works, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 08:19 AM
You are welcome
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader