How to find login user is manager or not

PriyankaS895282
Tera Contributor

I want to check whether current user is manager or not if he is manager then I want to auto pop all user under that manager in reporteer field and that field will be visible if that user is manager if no that field is not visible on catalog iteam

 

1 ACCEPTED SOLUTION

Ramesh_Naidu
Mega Guru

Hi @PriyankaS895282 ,

 

Use the below code and this will code to determine the user is manager or not.

var is_manager;
var gr = new GlideAggregate("sys_user");
gr.addQuery("manager",userID);
gr.query();
if(gr.getRowCount>0)
{
	is_manager = "true";
}
else{
	is_manager =  "false";
}

Thankyou.

View solution in original post

1 REPLY 1

Ramesh_Naidu
Mega Guru

Hi @PriyankaS895282 ,

 

Use the below code and this will code to determine the user is manager or not.

var is_manager;
var gr = new GlideAggregate("sys_user");
gr.addQuery("manager",userID);
gr.query();
if(gr.getRowCount>0)
{
	is_manager = "true";
}
else{
	is_manager =  "false";
}

Thankyou.