How to create a dynamic hyper link on catalog item which opens in same instance when it's clicked.

vahini
Giga Guru

Sharing this thinking it might help new developers working on catalog item.

 

When you get a requirement like keep an Hyper link in catalog item Description when clicked it should open another catalog item.

we can simply create hyper link but thing is it should automatically open in  the same instance it's clicked, in dev we might use dev url and when it goes to test we should not change url to test or prod.

 

To achieve this dynamic instance do this.

 

sample url : 

 

https://abcorpdev.service-now.com/now/nav/ui/classic/params/target/com.glideapp.servicecatalog_cat_i...

 

 

Modified url : 

https://abcorpdev.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=520ce5e547...

 

sysparm id is the sys id of catalog item

use the modified url, replace with your instance name , catalog item sys id or you can copy the url of catalog item you want to be opened when link is clicked and make it look like modified  url above.

 

********************************************************************************************************

Other way to keep link on catalog items : 

relative url 

 

com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=42d707e68759b4d41bd942ed0ebb354f

 

 

*******************************************************************************************

To keep kb as hyper link on catalog item use url like below 

 

https://theanti.service-now.com/ess?id=kb_article_view&sysparm_article=KB0036234

 

**************************************************************************************************

To keep ESS portal link as hyper link on catalog items and it should dynamically open in the instance we are in, follow below steps

 

Actual URL : 

https://abccorp.service-now.com/ess?id=sc_cat_item&table=sc_cat_item&sys_id=c4a2434dc3488h1038d83f3g...

 

Modified url above to below url

 

/ess?id=sc_cat_item&table=sc_cat_item&sys_id=c4a2434dc3488h1038d83f3g050131d8

 

insert this link in URL field , when clicked it takes user to ess portal in what ever instance they are in.

********************************************

OR Below Modified url also works, it opens in same instance and opens that catalog item.

actual url:

https://thehartforddev.service-now.com/ess?id=sc_cat_item&table=sc_cat_item&sys_id=0d5c20e6db556bc0e...

 

Modified URL:

/ess?id=sc_cat_item&table=sc_cat_item&sys_id=0d5c20e6db556bc0e563dda5ca9619f6&recordUrl=com.glideapp.servicecatalog_cat_item_view.do%3Fv%3D1&sysparm_id=0d5c20e6db556bc0e563dda5ca9619f6

0 REPLIES 0