Dynamic multiple choice filter that works only on Server
Hi Ninox Brain Trust,
Attached will be found a small database that has a filter for a dMC (Customer.Location) that only works on the Server.
Please look to see if there is an alternative formula that may work for the reference field (Orders.Location) .
As a workaround you will also find a dMC (Orders.Customer Locations) field that is also pointing at the Locations table. It appears to be working offline in the Mac App. However, I've been unsuccessful filtering with the current formula.
thanks for looking!
12 replies
-
Hi Sam -
Once you start working with multiple choice fields (regular or dynamic) then you can't use the equal sign so easily.
Luckily now you can use the contains() function to filter on arrays, so maybe try:
let t := this; select Locations where contains(numbers(t.Customer.Location), number(Id))
or you can do:
for loop1 in numbers(Customer.Location) do record(Locations,loop1) end
Since a dynamic field is based on a table we can get record Id so we can use the record() command in a for loop to get an array of the specific records that were selected. It could be faster depending on how large the base table for the dynamic field gets.
For the Contraints is would look very similar:
contains(numbers(a.Customer.Location), number(b))
-
said:
Since, there is only one location, it would be nice to have it auto populate the Location(s). That way if there are 2 or rarely 3, a choice could then be made.
I've tried several combinations of code and they all have an error unless I put an = sign .So now not only do you want the dynamic choice field to show only related records, but you want the choices to be selected. Is that correct?
If I choose Customer "Dick", "Here" and "There" show up for Customer Locations as possible choices.
You want those two choices to also be selected as well?
Looking at your sample DB, the Customer Location field in the Orders table is a dynamic choice field, so you can never select more than 1 choice. But some customer records can have more than 1 Location selected. How do you know which record to select?
Content aside
- 5 mths agoLast active
- 12Replies
- 71Views
-
2
Following