- 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 09:22 AM
Hello,
I think you are in London. Please set the following flag on your client script from a list view and it will work.
Set Isolate Script to true for your client script, This will allow DOM manipulations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 10:16 AM
Build
glide-kingston-10-17-2017__patch9-09-05-2018_09-12-2018_0933
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 10:18 AM
Don't see that flag
- 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:20 AM
That worked but it is showing %20 for spaces.
"testing%20passing%20information"
Had to add decodeURI to the final code.
g_form.setValue('description', decodeURI(comments));
Thanks