Here's "Try It (Portal)", a new tool in my useful tools series.  It's a "Form button" UI Action that will open up a new tab/window and load the current catalog item within the Service Portal:

_Screenshot.png

It's very similar to the OOB "Try It" UI Action that redirects the current window to the catalog item, but this one will open the Service Portal in a new tab/window for you.  There's nothing really special about it, but it saves you from loading the portal and trying to find it in order to test it out.

 

UI Action details:

Name: Try It (Portal)

Table: Catalog Item [sc_cat_item]

Order: 100

Action name: u_try_it_portal

Active: checked

Show update: checked

Form button: checked

Client: checked

Onclick: u_tryInPortal()

Hint: View this item within the Service Portal (opens a new tab/window)

Condition: current.active == true && new CatalogItemTypeProcessor().canTryIt(current.getRecordClassName()) && !(current.getRecordClassName() == "sc_cat_item_content" && current.content_type == "external")

 

Script:

function u_tryInPortal(){
  //view this item within the Service Portal in a new tab/window
  window.open("sp?id=sc_cat_item&sys_id=" + g_form.getUniqueValue(), "_blank");
}

 

If your Service Portal has a different URL suffix, just change the "sp" on line 3 to whatever is appropriate for your instance.

 

The condition is basically the same as the OOB "Try It" UI Action except I removed "current.canWrite()" because this UI Action is not performing a save.

 

I've attached an XML export of my UI Action record if you want to just import that.  Try it out in a personal dev instance first.

 

Related Posts:

"Developer Toolbox" Tool

"Preview GlideRecord Script" Tool

"Preview in Background Script" Tool

"Xplore GlideRecord Script" Tool

"View Data to Preserve" Tool

"Create Module From Query" Tool

"Clear User Settings" Tool

"Grab Grouped Information" Tool

Showing a Schema Map From a List View