
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 08:18 AM
Hi All,
I have scenario. where I have to restrict users to view the Catalog items in Serviceportal based on the level(a custom field value from sys_user form) configured to the user. Below is the code and it is not working as expected. I am not able to view the gs.log() content under System log--> All which is written on below code.
Please share your thoughts to figure out the issue.
Thanks
Venkatesh.P
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 12:50 AM
Hi Venkatesh,
Try the below solution (I've tested this in my personal dev instance)
var level= gs.getUser().getRecord().getValue('u_level');
var answer = false;
if(level>=6){
answer=true;
}
gs.log(answer);
Also ensure that this User Criteria is assigned in the 'Available for' in your Catalog item. This is usually not visible on the form so you may need to do Configure->Form Layout then select Available For then save the form.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 05:02 AM
Hi Regina,
Thanks for your inputs that worked for me as well. Is there any possibility to have a customized message instead of "You do not have permission to see this category" in service portal, where we had this catalog item in new category called "security"
Thanks
Venkatesh.P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 08:49 AM
Hi Reginabautista,
Actually I would like to know how can we restrict the users from submission of catalog item based on field.
For example,
here if user select the employee for departure catalog item, they must not be able to submit the request.
if the user select the contingent worker then they must be able to submit the request.
Contingent worker and employee are differentiated based on expired date field in user table
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 05:06 AM
Hi Venkatesh, could you mark my answe as correct please so this gets removed from the unanswered list
As to the second question let me see what I can find. Though not sure if possible. Also ideally this should be created on a separate thread so it can easily be found by others who have similar question..