Create records from dynamic multiple choice
Hi guys,
I hit a bump trying something new:
I have a dynamic multiple choice field called 'Keuze kritieke fases'
I have a subtable 'Kritieke fases'.
I have a button that I gave following code on click:
let xCurrRec := Id;
for i in 'Keuze kritieke fases' do
let j := (create 'Kritieke fases');
j.(Omschrijving := text(i));
j.(Projecten := xCurrRec)
end
So the goal is to have the multiple choice list as an easy way to quickly input a few records (1 record per 'Kritieke fase'), but still be able to tweak the field 'Omschrijving' depending on the case.
Except I'm getting a very strange output... (Image below, I select 3 choices, I get one empty record and one with 3 completely different choices concatenated). Anyone ideas?
14 replies
-
Joren Brouillard
Maybe these cascading dynamic choice fields could help you Joren :Steven
-
And here's the direct link: https://www.dropbox.com/s/qhrs8f6htf2sctj/Used%20Cars.ninox?dl=0
Steven
-
Hi guys,
I am sorry to reopen this post, but I would need some help please, although I am not very sure if its possible. This post was most similar regarding to my issue that I could find.
I didnt understand the last part unfortunately, so please excuse if I ask an already answer.
I added a small test db for better understanding.
What I would like to achieve is when chosing two or more categories in table dmcf_table, that all the items from subcategories show up, eg Cars and Bike --> BMW, Mercedes, Toyota, Honda, Kawasaki, Suzuki.
Is that doable?
Thanks a lot for taking time.
Kruna
-
Kruna said:
What I would like to achieve is when chosing two or more categories in table dmcf_table, that all the items from subcategories show up, eg Cars and Bike --> BMW, Mercedes, Toyota, Honda, Kawasaki, Suzuki.
Is that doable?Most things are doable in Ninox. Take a look at the uploaded DB to see the changes.
I'll also uploaded the changes here:
let myCat := for loop1 in numbers(CATEGORY) do record(Category,loop1) end; (select Subcategory)[var k := Kategorie; count(myCat[= k]) > 0] order by Text
The thing to remember with multi choice fields (regular or dynamic) is that once you choose the 2nd choice you now have more than one result so you can't just use the equal sign.
So I had to change your first variable to a for loop command so I can create an array of the choice(s) you made.
Then I can use that array in your select statement to find all records in Subcategory that have at least one of the items checked in Category.
You can view this post for more info.
I think it is best to start a new post instead of reopening one.
-
Rafael said:
Hi Fred, I try to use the formula to others Subcategory like Subcategory_2, etc but the formula don't work.
I send A sample DB as example.I don't see anything wrong. When I select anything in Subcategory 1 the proper records show up in Subcategory 2.
I don't understand the need for the Category field if there is only 1 choice.
-
The Category is the first level (The name of Project, only one element) the SUBCATEGORY 1 had 3 elements, but when use the formula for SUBCATEGORY 2 don't work, there are something bad in my formula, and I have 4 SUBCATEGORY.
let myCat := for loop1 in numbers('SUBCATEGORY 1') do
record('WBS_1',loop1)
end;
(select WBS_2)[var k := 'Kategorie 1';
count(myCat[= k]) > 0] order by IdWhen select Engineering I saw all elements on Engineering, Procurement, & Construction.
-
Rafael said:
When select Engineering I saw all elements on Engineering, Procurement, & Construction.I don’t see any problems on my end. When I select Engineering I only see Engineering. When I select Procurement I only see Procurement. When I select Construction I only see Construction. And when I select combinations the proper combinations show up.
Content aside
- 1 yr agoLast active
- 14Replies
- 413Views
-
5
Following