User Criteria Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello Everyone I had a task to create an user criteria for the following condition I have made it and was testing for users and its not working properly as it should can anyone help with this?
Its kind of urgent.
the provided criteria is in the photo
my query is
var id = gs.getUserID();
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', id);
gr.addEncodedQuery(
'departmentINjavascript:new Department().recursive_search_byID("53963")' +
'^ORdepartmentINjavascript:new Department().recursive_search_byID("53956")' +
'^OR(departmentINjavascript:new Department().recursive_search_byID("55375")^u_reporting_entity.u_codeIN3,936)' +
'^OR(departmentINjavascript:new Department().recursive_search_byID("65528")^u_reporting_entity.u_codeIN3,936)' +
'^OR(departmentINjavascript:new Department().recursive_search_byID("80009421")^u_reporting_entity.u_codeIN3,936)'
);
gr.query();
if (gr.next())
answer=true;
else
answer=false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Did you check the user criteria diagnostics?
I am not sure what it is you are trying to do, but your and/or conditions seem to be weird, since you are using the same ones a couple of times as 'and'.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have been asked for a user criteria and the condition is in the picture provided., and the script is the which I wrote.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
44m ago
That doesn't sound like a valid ask. You can't simply copy this one on one. Tell them you can only create something if you understand what it is you are creating, because it doesn't sound like you do.
And again my question: did you check the user criteria diagnostics.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @hiteshpradh
Is this AddedEncodedQuery is working in filter of Native view? Are you getting result?
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti