Does anyone know how to hide the Related List and Related Links in Reference icon popup window within Service Portal.

bindhustephen
Kilo Contributor

I created a clone of the OOB SC Catalog Item widget and added logic to pass the View "ess"
        data.sc_cat_item.view = "ess";
Now the reference icon popup form displays in "ess" view. But I see Related List, Related Links in the popup . Is it possible to hide these programmatically within the popup in Service Portal without modifying the View itself?

find_real_file.png

6 REPLIES 6

Shane J
Tera Guru

Can you restrict the UI Actions by role?  I'd think they would disappear if you did so.

bindhustephen
Kilo Contributor

I want the Links to disappear only on Service portal side. In the back-end SN Console I would like the links to keep appearing.

sushant007
Kilo Guru

@bindhustephen

We are facing same issue; is there anything you found for this issue?

Can you please shareh?

epinetti
Tera Guru

Hi

I had the same issue and found a solution by cloning the widget Form. I dont know if that is the best solution but works for me


Solution description

We have internal users (snc_internal) and external clients (snc_external). So, based on that roles difference I was able to hide or show the Relate links section 

Steps

1) clone Form widget

2) on Body HTML template find out

 

 <!-- related lists -->
      <div ng-if="!data.hideRelatedLists">

and replace by 

 <!-- related lists -->
      <div ng-if="!data.hideRelatedLists && c.isInternal">

 

3) On Client Controller add glideUserSession as a parameter and a new first line code

function ($scope, $rootScope, $timeout, spUtil, $location, $window, nowAttachmentHandler, glideUserSession) {

var c = this;

4) At the end of the Client, Controller (before closing the '}') add the following function

	glideUserSession.loadCurrentUser().then(function(currentUser) { 
	  
	   //alert(currentUser.hasRole('snc_external'));
	   c.isInternal = false;
	   thisUser = currentUser.hasRole('snc_external');
	   if(thisUser){
		 c.isInternal = true;
	   }
		
	});

 

and Voila! Works for me 🙂

 

You could apply the same idea for the section  <!-- UI Action Links -->

 

Note: I took the idea from this post GlideUser/g_user in ServicePortal