How to create user criteria in hrsd .

smt
Tera Contributor

Hi there,

 

I want to create user criteria that
The user or employee which are not contingent worker only these user can access hr service on portal 
its scoped application need help

 

var user = new GlideRecord('sn_hr_core_profile');
user.addQuery("user",user_id);

user.addQuery("employment_type","contingent");
user.query();
if (user.next()){
gs.info( user.employment_type);
return "true";
}else{
gs.info("else");
return "false";
}

 

 

 

 

 

 

thanks

6 REPLIES 6

Community Alums
Not applicable

Hi @smt ,

Create a HR criteria using a user criteria where provide the roles whom you want the access should be given.

Follow this link to create a HR criteria :https://docs.servicenow.com/bundle/rome-employee-service-management/page/product/human-resources/con...

Just for knowledge You already have a Role OOB for Contingent employees : sn_hr_core.hrsm_contingent

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

 

 

Community Alums
Not applicable

Hi,

For creating User Criteria for Portal:

You can apply existing user criteria to records in Service Portal through Service Portal configuration (Service Portal > Service Portal configuration). You can only create user criteria within the platform UI.

Procedure

  1. In the navigation filter, type Service Portal.
  2. Select a page, widget, or widget instance record.
  3. In the related list at the bottom of the record, select the Can View or Cannot View tab, then click New. If a user criteria record is already created, you can click Edit to apply user criteria to the page, widget, or widget instance.

    User criteria records are stored in the user_criteria table.

    User criteria for the Service Portal administrator

  4. Complete the fields on the form, as appropriate.
  5. Submit

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

smt
Tera Contributor

This user criteria is for hr catalog need to add in record producer 
so there is need to add user criteria in available for .
But need to create advanced script in user criteria .

Sean Antle
Giga Guru

Hi, smt,

There is a related link on the HR Criteria form that allows you to activate user criteria. See this product documentation for more information.

find_real_file.png