Business Rule to abort action not redirecting back to same record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2016 03:43 PM
I have a Business Rule running during update, with "When" as "Before", on the the sc_task table:
(function executeRule(current, previous /*null when async*/) {
if(current.variables.offboard_desktoprecoverassets == '' && current.state == "3"){
current.state=previous.state;
current.setAbortAction(true);
gs.addInfoMessage('NOTICE: Please select an option for desktop recovery below completing the task.');
gs.setRedirect(current);
}
})(current, previous);
Everything seems to working as the state changes back to Open (the previous state on a new catalog task), the info message comes up on the screen, but my redirect is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 12:25 PM
This doesnt work for me - still leaves page
var url = gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI();
gs.addErrorMessage("Error message");
current.setAbortAction(true);
gs.setRedirect(url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 06:43 AM
gs.setRedirect("/".concat(current.sys_class_name,".do?sys_id=",current.sys_id));