GlideURL question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hello all,
Good day!!.
On a catalog item, there is a select-box, and when I select Access request, it should navigate me to new access request form.
I can achieve this by creating a system property and use that in client script from script include.
But the property's value has to be changed manually in Prod instance. Hence I am thinking to use GlideURL which can be used at server side.
I am trying this, but the script include is returning null, can you please help me?
Below are the screen shots for Script include and On change CS:
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @Lucky1
in your client script replace
ga.getXML(function(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
This usually not work, sometimes GPT or some IA give this alternative but I’ve tried and not work.
As documentation try:
ga.getXML(HelloWorldParse);
And the function:
function HelloWorldParse(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); alert(answer); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@Lucky1 If you just want to store some value ( which has to be used in client script) and want to change that in prod, you don't need to write ajax and script include for that.
Go to "sys_ui_message" and create a record in that table with some key and message as value.
In your client script use getMessage('key') , where key is from sys_ui_message table. This will fetch the value dynamically from sys_ui_message table and can be changed in prod.
GlideAjax has to be used for more complex logics.
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
simply store the sysId of that catalog item in property and ask admin to change in prod.
your requirement is to simply take the user to that catalog item then approach I shared will work
script it like this
Script Include
var sysId = gs.getProperty('propertyName');
return '/esc?id=sc_cat_item&sys_id=' + sysId;
Client Script: Simply redirect it using top.window.open
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader