How to get current page URL when clicked the UI action

ramesh_r
Mega 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

Set Isolate script to false on the UI action record.

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Harsh Vardhan
Giga Patron

your script will work.

 

make "isolate script" field has false. 

 

find_real_file.png

 

 

 

 

Harsh Vardhan
Giga Patron

any update on this thread?

if i answered your query , kindly mark my answer as correct and close this thread. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ramesh,

What is your exact requirement here?

It seems in the UI action you are just want to get the url; show alert and then in server side code of UI action redirect to current record.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader