How to Redirect to current page in before update BR in scoped application(GRC: Advanced Risk)

sunil7
Giga Expert

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);
    }

 

3 REPLIES 3

suvro
Mega Sage
Mega Sage

Try this

 action.setRedirectURL(current);

Tried still not working 

MrMuhammad
Giga Sage

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

 

Regards,
Muhammad