Sugestion to deal with a problem

5 years 10 months ago #304987 by verdura
Sugestion to deal with a problem was created by verdura
Hi all,

I'm using CB to build a company directory with multiple fields to be fill by each company. There are 2 fields that I need to think better to implement them. My problem is classifying the companies in their respective area and products. We have 15 major areas and then we need to classify the products they make. In each of the 15 major areas we have 30 or 40 products. So my questions is what is the best way to address this? I'm thinking Dropdown Multi select in the areas and show Dropdown Multi Select with the products of the area chosen as they are selected. Is this possible? Do you think there's a better way?

Thanks

Please Log in to join the conversation.

5 years 10 months ago #304996 by krileon
Replied by krileon on topic Sugestion to deal with a problem
If you store the major areas and the products for those areas in custom database tables you'd be able to use CB Query Field to pull the custom values into a dropdown select. You'd then use CB Core Fields Ajax and its Update On functionality to refresh the products select when the major area select changes value. This would ensure the products would always be relevant to the area selected. Update On functionality is in CB Query Field, but it's no longer being further developed and will be removed so you could use that without CB Core Fields Ajax, but I do not recommend it as it will go away in a future release.

An alternative would be to just make all of your select fields manually then use CB Conditional to show/hide the relevant product select fields based off the major area selected.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.

Please Log in to join the conversation.

5 years 10 months ago #304997 by verdura
Replied by verdura on topic Sugestion to deal with a problem
Thanks for the reply

OK nice!
Being so it's almost a win...

Just to clarify: Field "Areas" in Dropdown Multi Select and as I choose Area1 the products field are populated with Product1 (from Area1), Product2 (from Area1). As I click Area2 the products field are populated with Product3 (from Area2), Product4 (from Area2) being added to prior Product1 and Product2. Final result:Product1, Product2, Product3 and Product4.

That's it?

Please Log in to join the conversation.

5 years 10 months ago #305006 by krileon
Replied by krileon on topic Sugestion to deal with a problem
Depends on how you want to do it. If using custom database tables with CB Query Field and CB Core Fields Ajax you'd just have 2 fields. The area and the products. When selecting an area it'd update the products displayed as you'd write your database query to check the value of the area field. If using CB Conditional you'd just be showing/hiding the relevant products field based off the value of the area field and will need as many product fields as you have area select options.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.

Please Log in to join the conversation.

5 years 9 months ago #305921 by ANIMEE
Replied by ANIMEE on topic Sugestion to deal with a problem
Hi,

When selecting an area it'd update the products displayed as you'd write your database query to check the value of the area field


I'm trying to do something like this example and using only 2 fields for it. The thing is, the first field saves in the database "PT.001|*|PT.002|*|PT.003" and so on... and in my child field (query field) what SQL Query should I use to populate the options according to the prior field choices?

Thanks

Please Log in to join the conversation.

5 years 9 months ago - 5 years 9 months ago #305938 by krileon
Replied by krileon on topic Sugestion to deal with a problem
Multi-select and multi-checkbox fields always store in the database as |*| delimitered. Use LIKE in your SQL to match values inline or use SQL functions to split the |*| into comma delimitered list which you can use FIND_IN_SET to search.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.
The following user(s) said Thank You: ANIMEE

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.199 seconds

Facebook Twitter LinkedIn