- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2022 09:54 AM
I am trying to redirect URL whenever user select reject option in list view then it should redirect to approval record the below script is working for Related List not for List view nothing is happening . please help in resolving this issue.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue=='rejected' ){
alert('ga is '+g_form.getUniqueValue());
// hosturl + "/sysapproval_approver.do?sys_id="+g_form.getUniqueValue();
var redirectURL = '/sysapproval_approver.do?sys_id='+g_form.getUniqueValue();
top.window.location=redirectURL;
saveAndClose = false;
}
else
{
saveAndClose = true;
}
callback(saveAndClose);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2022 12:09 AM
Hi,
g_form won't work in oncell edit
use this for getting sys_id of the row being edited -> sysIDs
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == 'rejected' ){
alert('ga is '+ sysIDs);
var redirectURL = '/sysapproval_approver.do?sys_id=' + sysIDs;
top.window.location=redirectURL;
saveAndClose = false;
}
else
{
saveAndClose = true;
}
callback(saveAndClose);
}
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
01-25-2022 10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2022 12:09 AM
Hi,
g_form won't work in oncell edit
use this for getting sys_id of the row being edited -> sysIDs
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == 'rejected' ){
alert('ga is '+ sysIDs);
var redirectURL = '/sysapproval_approver.do?sys_id=' + sysIDs;
top.window.location=redirectURL;
saveAndClose = false;
}
else
{
saveAndClose = true;
}
callback(saveAndClose);
}
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
01-26-2022 08:59 AM
Thanksalot