1539
Views
7
Comments
Solved
Condtional combobox source
Question

Hi,

Given:

  • Entity Car, Attributes: id, name, isOnlyToSellByManager 
  • Entity Salesman, Attributes: id, name, isManager 
  • Entity Car_Salesman, Attributes: Id, SalesmanId, CarId

How do I populate a combobox (to add cars to the Car_Salesman entity) when I want to show all cars if a the salaesman is a manager and if he/she isnot then only show cars where isOnlyToSellByManager is False?   

Regards, Harry

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Or, use an If statement, use an appropriate Aggregates for each path of the If, and assign the output to a common List that you use in the combo box.

2021-02-15 13-40-57
Shashank Diwan

Hi Harry,

I think you can still have one source for the combobox, rather you add these conditions into your query. You can pass these values as Input parameters in your query. You may use advance query instead.


Shashank...

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Or, use an If statement, use an appropriate Aggregates for each path of the If, and assign the output to a common List that you use in the combo box.

UserImage.jpg
Harry de Boer

Thank you. I'll go for Kiian's solution (and will look into Shasank's later on - needs a little more SQL)

Regards, Harry

2025-01-09 14-56-57
IQ78

hi de Broer:

Given:


Find:


Solution:

1. create server action:

 with filtering on aggregate GetCarwithSalesmen:

2. assign that function to car widget combobox:


3. Ajaxize when you change the Saleman widget value to both widgets - saleman and car:

For your convenience, i attached the Oml:

 

regards,

bb

ComboInvestigation.oml
2020-10-28 09-51-07
Felipe Santos

Nice sample and explanation

UserImage.jpg
Harry de Boer

Thanks BB!

Harry

2014-10-21 20-15-17
Alberto Ferreira

BB Nice and clear explanation of conditional use of combobox!!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.