Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Before update br not reloading page on setabortaction

Hasan6
ServiceNow Employee
ServiceNow Employee

I am using a Before update business rule, where I want to abort an update action and reload the page.

But I am not able to reload the page, I am getting invalid update error on the form but the page is not reloading.

The data is reset after a manual browser reload.

 

code for before update business rule:

(function executeRule(current, previous /*null when async*/) {

    // Add your code here
    current.setAbortAction(true);
    action.setRedirectURL(current);

})(current, previous);

 

Original record:

find_real_file.png

 

After modifying on ui, not pressing save/update

find_real_file.png

 

After clicking save:

find_real_file.png

 

Reloading the page:

find_real_file.pngThanks in advance.

1 REPLY 1

Allen Andreas
Tera Patron

Hi,

You can try swapping the redirect before the abort and see if that works, otherwise, you'd want to address this within the client form.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!