Search on sys_user is listing out all relevant records

ArpitaVK
Tera Expert

1. I have a reference field on UI page review_request, referencing to the sys_user table. I have written a query to filter out the members which are active=true and has role ITIL. When searched by clicking on magnifying glass on that field, the window displays correct records. But when I type in the name, it displays all the relevant records; even those which does not satisfy above condition. Is this behavior OOB? If not, any solution for this?

 

2. The dictionary attributes have been applied to the same field to refer to the columns User ID, first name and last name which searching a particular record. User ID in our case is mix of alphabets and numbers. When I type in name, it filters out the records by Name contains......or Name starts with..... Is this OOB? and if searched with exact user ID, it has no records to display because it is searching on Name field only. Is there any solution?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Use this, you will get correct results

 

<g:ui_reference name="manager" completer="AJAXTableCompleter" query="active=true^roles=ITIL" id="manager" table="sys_user" columns="user_name;first_name;last_name" />

 

AnuragTripathi_0-1709900309352.png

 

 

Guess his answers your question

 

 

-Anurag

View solution in original post

8 REPLIES 8

Ohh i didnt realize you edited the question,

 

Yes the search is always starts with, unless users enters * and then types something. This is OOB.

Basically this field on the ui page should work same as it does on any form.

-Anurag

Okay, but every time it is filtering the Name column only. I have a requirement that it should filter the users based on the entered UserID as well.

That works with the ref_ac_column and ref_ac_columns_search=true attributes, I havent used them in a ui page myself but try and see if it works. 

-Anurag

Try this way 

 

AGLearnNGrow_0-1709903311439.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************