- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 07:50 AM
I have created a UI Action that runs server side and redirects a user to a Record Producer. The UI Action adds data to the URL (UI Action Redirect : com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=21378b88db9e2300c218d740cf961961&sysparm_comments=testing passing information). Within the Catalog Client Script I am trying to read the URL to get the parameter needed for defaulting some of the fields on the Record Producer screen.
Everything I have read looks like I should be able to do the following to get my data out of the URL. document.URL.parseQuery(); This command is not working. I keep getting the error 'Cannot read property 'URL' of null'.
Stuck as to how I get my information out of the URL
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 10:24 AM
Ok, Can you try this once.
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var comments = gUrl.getParam("sysparm_comments");
g_form.setValue('description', comments);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 11:22 AM
What is the difference between GlideURL() and using 'document' ?
Is one better than the other? In case I would be in a situation where both solutions would be working for me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 11:25 AM
document.URL is the legacy Javascript method using in the web based systems
https://www.w3schools.com/jsref/prop_doc_url.asp
GlideURL() is a SN specific API used for the same purpose and i bet that this is better than the legacy one as it avoids the direct DOM manipulation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 03:29 AM
Hey Ali,
I did a bit of experimentation. GlideURL() on a client script fails for a record on Portal / Workspace. At least until the Madrid release. I was trying to get a CS to run on a targeted view, say, 'Service Portal' *view=sp*. Works on the platform UI no probs. But, this API has at least this one gap that SN may plug in a future release.
Cheers.
Jai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 07:45 AM
Hi Jai,
It seems GlideURL is not supported in the portal framework. There is an alternative GlideURI API for scoped apps but that doesnt work either.
Guess we need to go with the legacy JS objects.
top.location.href returns the URL in both platform and portal and works for both scoped and global apps. Not a neat one though!
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2019 08:18 AM
Super helpful Ali, thanks!