glide.servlet.uri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 07:00 PM
Hi Team,
In my project we are using custom uri's, i just want to compare both the uri's(Prod and DEV) and it should display Production uri. Can anyone suggest me.
Thaks
CSR
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:03 PM
You can use the following:
gs.getProperty('glide.servlet.uri') will return the current instance url. For example:
https://yourdevelopmentinstance.service-now.com/
https://yourpoductioninstance.service-now.com/
So you can compare like this:
if(gs.getProperty('glide.servlet.uri') == 'https://yourpoductioninstance.service-now.com/'){
//display prod
}
Or check if it contains the production prefix:
if(gs.getProperty('glide.servlet.uri').indexOf('yourpoductioninstance')!=-1){
//display prod
}
Let me know if that answers your question! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:12 PM
Or use:
gs.getProperty("instance_name")
That will only return the prefix. So devxxxx or yourpoductioninstance
Then compare it like:
if(gs.getProperty("instance_name") == 'yourpoductioninstance'){
//display prod
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:37 PM
Hi Willem,
Thanks for the quick response.
Here my ask is
in my prod having two url's, backend value showing "olprod" and fronend value displaying "csprod". i wanna display only "Csprod". Please suggest how can i achieve this.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 10:38 PM
What do you mean with "my prod having two url's"? And what do you mean with back end and front end value?
Where do you want to display this?