How to get current page URL when clicked the UI action

ramesh_r
Giga Sage

Hi All,

I want to get current page URL when click on the current URL in UI Actin

I wrote

function moveToAuthorize() {
	var url = document.URL.parseQuery();
	alert(url);
    gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_scheduled");
}

if (typeof window == 'undefined')
    updateAndRedirect();

function updateAndRedirect() {
    var url = gs.action.getGlideURI();
   gs.addInfoMessage(url);
    action.setRedirectURL(current);
}

this script but its not working

8 REPLIES 8

AbhishekGardade
Tera Sage

Hello Ramesh,

Probably a system property glide.servlet.uri would help you achieve it.

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Elijah Aromola
Mega Sage

You can use the following:

  var gURL = new GlideURL();
  gURL.setFromCurrent();

  // you can get params by doing the following
  var param = gURL.getParam("parameter_in_url");

Prateek kumar
Giga Sage

Try


function moveToAuthorize() {
var url = window.parent.location.href;
	//var url = document.URL.parseQuery();
	alert(url);
    gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_scheduled");
}

if (typeof window == 'undefined')
    updateAndRedirect();

function updateAndRedirect() {
    var url = gs.action.getGlideURI();
   gs.addInfoMessage(url);
    action.setRedirectURL(current);
}

Hi Prateek 

i am getting this below error

 

find_real_file.png