When user clicks on approve ui action they are getting redirected to a different page. But they should be re directed to the same page.

Rajesh PanneerS
Tera Contributor

When user clicks on approve ui action they are getting redirected to a different page. But they should be re directed to the same page.Below is my code, but it's not working.

current.approval = "approved";
current.update();

new UIActionUtils().approvalsNoLongerRequired(current.sys_id);
action.setRedirectURL(current);

1 ACCEPTED SOLUTION

action.setRedirectURL(current);   should be used before current.update();



action.setRedirectURL(current);


current.approval = "approved";
current.update();


new UIActionUtils().approvalsNoLongerRequired(current.sys_id);




If this doesn't work, then there might be some error and you should check error logs.


View solution in original post

5 REPLIES 5

action.setRedirectURL(current);   should be used before current.update();



action.setRedirectURL(current);


current.approval = "approved";
current.update();


new UIActionUtils().approvalsNoLongerRequired(current.sys_id);




If this doesn't work, then there might be some error and you should check error logs.