Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

gs.getProperty('glide.servlet.uri') is not working

KartikM49574975
Kilo Sage

Hello all

I used gs.getProperty('glide.servlet.uri') in one of my script and it's not working as expected, it's returning like: 

https://<instance-name>/not_found.do?page_url=https://<instance-name>/

 

And we are observing this issue after upgrading to Xanadu. 

 

also pls refer the script:

var sys_id = current.sys_id;

var url = gs.getProperty('glide.servlet.uri')  + "<table-name>?sys_id="+ current.u_return_no + "&sysparm_record_target=<table-name>&sysparm_record_list=";

action.setRedirectURL(url);
action.setReturnURL(current);

//table-name - actual table name

 

Any assistance in resolving the issue would be greatly appreciated. 

Thanks and Regards

Kartik Magadum

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@KartikM49574975 

If it was working fine then it's a platform bug. Did you try running background script and see what value came?

As an alternative try to use gs.getProperty('instance_name') to get instance name and then form the url

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

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

@KartikM49574975 

Thank you for marking my response as helpful.

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

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

Surabhi7
Tera Contributor

Hi,

 

You found any solution on this? we are also facing this after upgrading our instance to Xanadu Patch 3

 

Thanks

Surabhi

Runjay Patel
Giga Sage

Hi @KartikM49574975 ,

 

It should work fine, share your code where you have written this.

RunjayPatel_0-1735214313396.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------