User Creteria not working for a Record Producer

SandeshD
Tera Contributor

Hi Team , 

 

We have a Record Producer created , we have a custom column/field called as "Function" whose value is "People" in the User table , we want to hide the Record Producer from these People function user.

 

I have tried the below script in the Not available for , 

 

answer = true;
var grp = new GlideRecord('sys_user');
grp.addQuery('sys_id', user_id);
grp.addEncodedQuery('u_sf_function=******');//sf function=people
grp.query();
if (grp.next()) {
    answer = false;
}

Which is failing , still the users are able to see it , kindly assist!
8 REPLIES 8

Hi @Ankur Bawiskar ,

 

Not Working.

@SandeshD 

Please respond to below questions

1) share the field dictionary screenshot.

2) what's the field type? what debugging did you do?

3) is that an encrypted field?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

SandeshD_0-1744116608098.png

 

@SandeshD 

I could see in screenshot edge encryption is enabled for it.

Possibly that's the reason you are unable to get value for it in query

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader