Hiding Speedsearch Based on a Secured Action in the Infor SLX CRM Web Client

In the standard web client there is a secured action called “Toolbar/Tools/AdvancedSpeedsearch/View” that gives you access to the Tools/Advanced Speedsearch menu item. That menu lets you open up the advanced Speedsearch search screen.

However there is no such ability to prevent users from using the general Speedsearch functionality located in the upper right corner of the web client.

We can add such functionality. The easiest way to do so is to utilize our Custom Loader module. With that we can add a new javascript file under the Scripts folder of that Custom parent folder.

Inside of that new javascript file we would add the following code:

require(["dojo/ready"], function(ready){
  ready(function(){
   
	var canSeeSpeedsearch = false;
	var roleService = Sage.Services.getService('RoleSecurityService');
	if (roleService) {
		var accessList = roleService._getAccessList();	
		canSeeSpeedsearch = roleService.hasAccess('SpeedSearchNavigation');
	}

	if (!canSeeSpeedsearch) {
	   var ss = dojo.byId('SpeedSearch');
	   if(ss) ss.style.display = "none";
	}

  });
});

This sample code looks to see if the current user has a secured action named “Speedsearch” assigned to one of the Roles they are a member of. If not, it will hide the Speedsearch field in the upper right of the client.

Because we are using the Custom Loader module this code will automatically be added to all pages.

ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published.

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!