Redirect URL through business rule

Community Alums
Not applicable

Hi,

I need to redirect the URL to a different page through business rule.

I am using gs.setRedirect(url) by setting up the url.

Once the condition are true, it showing the form using the above parameter but it's redirecting to new url but opening the form in the bottom same page. 

Please advise. 

1 ACCEPTED SOLUTION

Community Alums
Not applicable
Thanks Everyone. We did it with help of writing onLoad client script and then used navigation parameter. From business rule we are passing a variable through g_scratchPad.

View solution in original post

13 REPLIES 13

Community Alums
Not applicable

Hi Ankur, 

Actually i am setting this parameter in display business rule which have other logic.

When all the validation passed, then i need to redirect the page to this specific record with sysid.

I tried with the above parameter but it's not redirecting to that page rather opening that specific records in the bottom of the current page. 

Hi Amit,

So the redirection code is in display BR?

Can you give complete context of what you are trying to achieve?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Yes, redirection code is written in display BR. 

We are validating some mandatory rules by displaying error message in the form if their is any fields which is blank in the child table. If all the rules are passed, we are comparing the flag value and then performing a redirection to the parent table.

Parent form is getting displayed with above method but not as a new URL but in the bottom of the current page. 

Pooja Mallikarj
Kilo Sage

Hi Amit,

May I know how you are passing URL?

Are you passing directly as parameter or are you storing in any variable and then passing.

try with below.

gs.setRedirectURL("try to paste your url here directly "); 

Thanks,

Pooja M

Community Alums
Not applicable

Hi Pooja, 

I tried pasting the URL directly in the parameter, still the new page is displayed in the bottom of the current page.