Autocomplete function on CB query field

2 months 1 day ago #312895 by wegda
Ive got a query for my column cb_rdapartnernr(lik user_id) thats it unique. My sql query works fine an tells the editor when the rdapartnernr is in used.
But now is it possible to show or insert automaticly a free number names rdapartnernr ? Can u give me an explain?
2 months 1 day ago #312896 by krileon
The autocomplete feature only applies to text fields. When the user begins typing it can suggest values for them to select which will insert into the text field. It will not limit them to only using those selections. So with that said simply edit your text field then under Integrations > CB Query Field > Auto Complete you can configure it as follows.

Query Auto Complete: Enable
Query:
SELECT `id`, `username` FROM `#__users` WHERE `username` LIKE '[value]%' LIMIT 10
Value Column: id
Label Column: username
Minimum Length: 3

With the above example it would autocomplete a users username and store the users user id. The "Value Column" parameter determines what is inserted into the text field while "Label Column" is just for display purposes. So if you need it to insert some sort of new number based off the current numbers you'll need to generate that and return it in your SQL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
2 months 23 hours ago #312903 by wegda
Aha ok. So it is possible to suggest a free number inside the column thats is not in use?
2 months 22 hours ago #312907 by krileon
Yes, I assume you've a database table with those free numbers listed somewhere? If so you'd just make sure your query is querying that table and joining _comprofiler to check that it doesn't exist before suggesting it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
1 month 1 week ago #313260 by nant

wegda wrote: Aha ok. So it is possible to suggest a free number inside the column thats is not in use?


This video should help

Moderators: beatnantkrileon
Time to create page: 0.439 seconds
Facebook Twitter Google LinkedIn