- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2023 10:51 AM
I have a Catalog Item with one Select Box variable. Depending on the choice the user selects, I want the page to redirect to a different Catalog Item URL. I have created a Catalog Client Script on the Catalog Item called "Redirect URL." It has the following onChange script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var value = g_form.getValue('mt_issue_access');
var accessUrl = 'sp?id=sc_cat_item&table=sc_cat_item&sys_id=42d84a101b1df5102d36751bdd4bcbe7';
if (value == 'issue') {
return;
} else if (value == 'access') {
g_navigation.open(accessUrl);
}
}
The IF statement should open the URL specified when the "Request software access" choice is selected. However, when selecting that choice, I am getting the following Java exception: Error while running Client Script "Redirect URL": ReferenceError: g_navigation is not defined
According to the documentation, it seems like g_navigation is a client-side class, so I'm not sure why it is showing as undefined. Here is the Catalog Client Script if needed:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2023 11:13 AM
Hi @Oliver Anderson ,
try top.window.location(accessUrl)
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2025 08:45 AM
Trying to do same thing, g_navigation *should* have worked, but of course SN being SN, most things that should work don't. Anyway, thank you for this correctly updated answer.