
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 11:34 AM
Hi All,
I have a UI Action, which I am using as a List Context menu and List Choice.
I am calling a UI Page from this UI Action. I want to send this current URL as a parameter, but unable to senmd so.
I tried using alert ,but the UI Action itself is not working.
can someone help me in resolving this issue ? See the below code:
function LinkFP() {
var url = window.parent.location.href;
alert(url) ---------> Not working
//collection paramater to pass to the UI Page
var listID = g_list.listID; //table name
var rec_list = g_list.getChecked().toString();//sysid of the item checked.
var rec_query = g_list.getQuery(false, false, true); //query that currenty on the form
var list_count = g_list.getRowCount(); //count of all the records based on the query filter
var o_dynamic = rec_query.indexOf("DYNAMIC");
if(o_dynamic <0){
//call the glidemodal UI Page
var url = GlideURLBuilder.newGlideUrl("sn_si_FalsePositiveRequest.do");
url.addParam('selected_list_count', list_count);
url.addParam('selected_rec_list', rec_list);
url.addParam('selected_rec_query', rec_query);
url.addParam('selected_instance', url);
url.addParam("sysparm_nostack", "no");
Regards,
Dheeraaj
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 04:14 PM
I was able to figure out this myself.
Thanks all.
For anyone looking to implement the same thing, I am pasting the code below:
var glide_url = new GlideURL();
glide_url.setFromCurrent();
var target = glide_url.getParam("sysparm_query");
Regards,
Dheeraaj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 11:39 AM
You can try using gURL:
var gUrl = new GlideURL();
gUrl.setFromCurrent();
alert(gUrl)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 11:45 AM
Hi,
I used the above script and it is alerting gUrl ?
Is there any script missing ?
Regards,
Dheeraaj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 01:41 PM
I mean its not alerting the value, its alerting the word "gUrl"
Is there any script that that I am missing ?
Regards,
Dheeraaj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 04:14 PM
I was able to figure out this myself.
Thanks all.
For anyone looking to implement the same thing, I am pasting the code below:
var glide_url = new GlideURL();
glide_url.setFromCurrent();
var target = glide_url.getParam("sysparm_query");
Regards,
Dheeraaj