Service Catalog Request - Re-direct to external URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:16 AM
Hi,
I'm trying to create a catalog request which re-directs the user to an external URL. I want the code to run "On Submit" so that the request is recorded and preferably the URL opens in a popup window. I currently have this (in a Catalog UI Policy - I've tried several Client Scripts but to no avail)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:21 AM
you can use onSubmit catalog client script and use Synchronous Ajax so that the request is submitted and it opens url in new tab
UI policy script is client side so gs object won't work there and also action object won't work
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:34 AM
Hi Ankur, thanks for your speedy response.
Would something like the following be appropriate?
function onSubmit() {
// Replace 'https://example.com' with the URL you want to open
var newURL = 'https://example.com';
// Open the new URL in a new tab
window.open(newURL, '_blank');
// Return true to allow the form submission to proceed
return true;
}