How to Redirect to current page in before update BR in scoped application(GRC: Advanced Risk)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 10:28 PM
Hey Everyone..
I want to redirect form to current record after updating the form using before update business rule ..but it redirecting me to old record..below is my code please help. I am getting the the log but its not redirecting
if (flag == 1) {
gs.info("flagCheck " + flag);
current.u_state = 'monitor';
current.u_substate = '';
current.u_approval_status = '';
current.u_approver_rejector = '';
var url = 'https://idfcfirstbankdev.service-now.com/sn_risk_advanced_rcsa.do?sys_id=' + current.sys_id;
gs.info("url " + url);
gs.setRedirect(url);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 10:56 PM
Try this
action.setRedirectURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 11:37 PM
Tried still not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2022 03:10 AM
Hi,
I assume you are using the Update button so its taking you to the previous screen instead of current. I believe the reason it's not working is that you are using before business rule so the redirection is being overridden by the Update button redirection.
I'd suggest writing an additional business rule and that would be after BR to redirect it to the current record (keep existing before BR in place and remove the redirection from that). Apply some good conditions so that it doesn't run in every case but just when it needs to be.
Hope that helps!
Please mark this helpful/correct, if applicable.
Regards,
Muhammad
Muhammad