g_navigation.open is not working in UI Action - Workspace

Ganeshm1
Tera Guru

Hi,
I have created a UI Action in one of the custom scope for taking the users to one specific portal page. 

 

Ganeshm1_0-1748333494622.png


But redirect is not happening as expected. Can anyone suggest me on this.

Even I tried window.open but it didn't work as expected. 

Thanks in advance!

 

Best Regards,
Ganesh

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Ganeshm1 

use this in workspace client script

Something like this and you need to use open(url) method.

function onClick(g_form) {
	
	var url = "/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=c5a8f3720703a0102011ff208c1ed0eb"; // pass your URL here
	open(url);
	
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Ganeshm1 

use this in workspace client script

Something like this and you need to use open(url) method.

function onClick(g_form) {
	
	var url = "/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=c5a8f3720703a0102011ff208c1ed0eb"; // pass your URL here
	open(url);
	
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hello @Ankur Bawiskar : Thanks for your response. it worked as expected. 

It worked for me 🙂