I have to check User is manager.

niveditakumari
Mega Sage

Hi, 

 

I have to check User is manager. I have created HR criteria on HR profile table and I have added condition in that HR criteria and I have to add one more condition to check User is manager. 

Can anyone please tell how I can check User is manager in this HR Criteria. 

 

Regards, 

Nivedita

 

 

5 REPLIES 5

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Try this

answer = checkIfManager();

function checkIfManager(){

var gr = new GlideRecord('sys_user');
gr.addQuery('manager', gs.getUserID());
//gr.addQuery('active', true); //optional
gr.query();

return gr.hasNext();

}

 

AnuragTripathi_0-1695812499235.jpeg

 

 

-Anurag

Hi @Anurag Tripathi

 

Thank you so much for your reply. 

Can you please tell where should I add above code. 

 

Regards, 

Nivedita

 

 

This is the user criteria.

 

-Anurag

 

You mean to say that I need to open Related User criteria that is available in HR criteria and I need to add above code. 

Please correct me. 

 

Regards, 

Nivedita