Service portal and view rules

Tim Grindlay
Kilo Sage

I have a custom task form whose view is governed by view rules. If I want to force a specific view only in the service portal, can I do it only using view rules? 

1 ACCEPTED SOLUTION

Utpal Dutta1
Mega Guru

Hey Tim,

 

You can refer to below mentioned blogs. In case if you need further assistance please let me know with your business requirement.

 

https://community.servicenow.com/community?id=community_question&sys_id=d35b0b21db9cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=63545a6bdbbe6700d6a102d5ca96...

 

If my answer helps then mark my answer Correct and Helpful.

 

Thanks and Regards:

Utpal Dutta

View solution in original post

4 REPLIES 4

Utpal Dutta1
Mega Guru

Hey Tim,

 

You can refer to below mentioned blogs. In case if you need further assistance please let me know with your business requirement.

 

https://community.servicenow.com/community?id=community_question&sys_id=d35b0b21db9cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=63545a6bdbbe6700d6a102d5ca96...

 

If my answer helps then mark my answer Correct and Helpful.

 

Thanks and Regards:

Utpal Dutta

Thank you. This is what I used from the links you provided:

 

(function overrideView(view, is_list) {
	
	//get URL details
	var url = gs.action.getGlideURI().getMap();

	//Determine if in portal view
	var isPortal = url.get('portal_id');
	
	//If user doesn't have itil or is on the portal use self-serve
	if(!gs.hasRole('itil') || isPortal);
		answer = 'self_serve';  // set the new view to answer

})(view, is_list);

Happy to help.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Tim,

Are you saying in view rule when it is portal always all users should have particular view and view rule should not execute; in the script section you can determine whether it is portal or native

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader