Restrict users from raising request when requested for user doesn't have Manager for their profile

User351756
Giga Expert

How can we restrict users from raising a request from portal when the Requested for user doesn't have Manager associated against their profile. 

10 REPLIES 10

Ramkumar Thanga
Mega Sage

Hi 

 

Could you please elaborate your question. Whether you have to restrict it for a single catalog item/record producer or the entire requests available in portal.

Hi,

 

The requirement is for a single catalog item. If 'Requested for' user doesn't have manager then user should have an alert message and should not be able to raise the request.

Hi Please create a user criteria with the following script to restrict the users with no managers. SO the request itself will not be available for him in the UI.

 

You can create a user criteria by creating a new record  under the related list Available for.

 

RamkumarThanga_0-1682585727712.png

 

 

answer = checkIfManagerNotempty();

function checkIfManagerNotempty(){

var gr = new GlideRecord('sys_user');
gr.addEncodedQuery('managerISNOTEMPTY');
gr.query();

return gr.hasNext();

}

 

Thanks!!

Ram

 

Please mark this as Helpful/Correct

Hi Ram,

 

I don't want to have user criteria because, the restriction is for just one category/subcategory in the catalog item. The form with other categories should still be visible for everyone.

 

Thanks,

Mounika