Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Alert message redirection

Anoja
Mega Sage

Hi,

When I am submitting record producer form from the portal alert message is displayed. If i click "Ok" on the alert message redirect me to the homepage.

Thanks in advance.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

To demonstrate your issue, I have used an onChange client scrip, you can have your logic the code more or less remains the same

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    if (newValue == "true") {
        var url = "https://community.servicenow.com/communityid=community_user_profile&user=33b26047db00441823f4a345ca96192a";
        alert("hey");//  your alert
        top.window.open(url, "_blank");// code to redirect to url
    }

}

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @Chekuri Anoja ,

You will have check the script for the button to which URL it's redirecting to.

This is how you set the redirect URL :https://community.servicenow.com/community?id=community_question&sys_id=c7d4c522db0718103daa1ea66896...

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

Community Alums
Not applicable

Hi @Chekuri Anoja ,

Glad to see my answer helped you, Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

Aman Kumar S
Kilo Patron

Hey,

To demonstrate your issue, I have used an onChange client scrip, you can have your logic the code more or less remains the same

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    if (newValue == "true") {
        var url = "https://community.servicenow.com/communityid=community_user_profile&user=33b26047db00441823f4a345ca96192a";
        alert("hey");//  your alert
        top.window.open(url, "_blank");// code to redirect to url
    }

}

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

Is your issue resolved?

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar