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.

Portal Redirection

Utkarsha
Tera Contributor

Hello All, Good day!

I have been working on a record-producer for one of my requirements that says Once the user clicks on submit button on service portal.
A popup should be displayed with message "This page has been moved to new external platform" and 
after 3 seconds user should be redirected to the new intake form. Here, timing functionality is important

Is there a way I achieve this functionality by keeping time limit of 3 seconds as well?

All suggestions are welcome,

Thank you

1 ACCEPTED SOLUTION

Hi @Utkarsha in your record producer write a onSubmit client script with below code

function onSubmit() {
    alert("test");

    return false;
}
    setTimeout(setTimerDelay, 3000); /*to set the timer for 3 sec*/
    function setTimerDelay() {
        alert('timer waits for 3 sec');

        top.window.open("Your URL here", '_blank');
     
    }
Regards
Harish

View solution in original post

4 REPLIES 4

Harish KM
Kilo Patron
Kilo Patron

Hi @Utkarsha you can use gs.sleep(3000); // for 3 seconds to pause the execution

Regards
Harish

Hi @Harish KM ,

Thanks for replying....where I should use this, if you can suggest me?

Thank you

Hi @Utkarsha in your record producer write a onSubmit client script with below code

function onSubmit() {
    alert("test");

    return false;
}
    setTimeout(setTimerDelay, 3000); /*to set the timer for 3 sec*/
    function setTimerDelay() {
        alert('timer waits for 3 sec');

        top.window.open("Your URL here", '_blank');
     
    }
Regards
Harish

@Utkarsha  

You can directly make use of your Record Producer script which is there in your Record Producer and use the script:

Within the Platform UI:

producer.redirect="home.do";

Within Service Portal:

producer.portal_redirect = "sp?id=sc_home"; // give here the portal page name

 

As you want to have a delay, so above this code, you can add the delay.

 

If my response helps you in any way, please mark my response as helpful or "Accept as Solution"

Thank you