- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-08-2021 02:52 AM
Hi there,
Created a simple Try it [Portal] Button for catalogs and order guides.
When ever we are working on the catalog or order guide we usually go to the portal page and open the item but by using this button we can open the items from the native UI.
So, the functionality of this button is when we click on it, it will open the catalog or order guide in service portal.
Code:
Name: Try it[Portal]
Table: sc_cat_item
Onclick : onportal()
Condition:
current.active==true;
Code:
function onportal() {
var url = '';
var tablename = g_form.getTableName();
var sysId = g_form.getUniqueValue();
var ins = 'https://dev12345.service-now.com/'; // here change your instance number accordingly
if (tablename == 'sc_cat_item' || tablename == 'sc_cat_item_guide' || tablename == 'sc_cat_item_producer') {
if (tablename == 'sc_cat_item')
url = ins + "sp?id=sc_cat_item&sys_id=" + sysId; //for Catalog
else if (tablename == 'sc_cat_item_guide')
url = ins + "sp?id=sc_cat_item_guide&sys_id=" + sysId; //for Order guide
else
url = ins + "sp?id=sc_cat_item&sys_id=" + sysId; //for Record producer
top.window.open(url); // (OR) g_navigation.openPopup(url) we can use both if we want to open in new or next tab.
top.window.location=url; //Use this if you want to open in same tab
}
}
Screenshots:
If this article helps you, Please mark it as helpful or bookmark it!...
Cheers,
Murthy
- 2,147 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
very useful content
Thanks for the article
thanks and regards
Sure Sai venkatesh
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Very Usefull article, Thanks for the work.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice One.. and even we can make it dynamic by adding current.cat_item.sys_id
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice one interesting ,Very usefull article.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice Article .
Thanks
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Glad to help.
Thanks
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Gaurav ,
can you pls explain more on this , like how can we make this dynamic .
Regards,
Akanksha
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you:)