September 15, 200916 yr Hi, I have a many to many relation (patients <-> allergies) Tables: patient, allergy, join_patient_allergy Problem: On the Patient layout I would like to have a checkbox for each allergy. I've looked into the JoinDemo.fp7 (found somewhere in this forum) to better understand this type of relationship. There the solution is a portal but I would like to use the checkboxes and I don't know how. Any ideas? Regards ChiSao
September 15, 200916 yr It opens a different problem, because facilitating each join table record with a checkbox with the shortest possible value list is just a graphical issue easily solved in layout mode. But each record would then need to be pre-populated with records - one for each required allergy. This could talk in favor of omitting the join table or instead use this approach: http://www.fmforums.com/forum/showpost.php?post/149069/ If you not are fully aware of what he does in this template, would I suggest you make the many 2 many join'less. --sd
September 16, 200916 yr I found that I'd better make a template showing how would approach it... --sd allergies.zip
September 16, 200916 yr Author Thanks a lot seems to be a nice solution but I have to take a closer look to the template to understand the mecanisme. Nice to have such a help in this forum. Regards by ChiSao
September 17, 200916 yr Author Thanks a lot! This one is easier to understand ;-) I will work with this one by ChiSao
September 17, 200916 yr There would possibly be something to crack though, what he does isn't a layout format checkbox but an emulation via the boolean formatting of numberfields, but yes very elegant indeed! If it should be easier to grasp is another thing ... if relational structures side gain is to prevent lengthy scripting ... not that the scripting here is whopping though. --sd
September 17, 200916 yr IIUC, your file avoids scripting by leaving an orphaned join record when unchecking a box. So for example, counting a patient's allergies by Count ( Join::PatientID ) would return an incorrect result. I am also not at all sure how you intend to keep Allergies and Slots synchronized: currently, if you delete an allergy, you are stuck with an empty portal row holding its place.
September 17, 200916 yr Count ( Join::PatientID ) would return an incorrect result. But I would count on the check'ed field instead... the value is even one, so Sum( would do similar if you delete an allergy, you are stuck with an empty portal row holding its place. Yes that's true - but how often will an allergy evaporate for ever! So if that happens will a scripted replace of the ID's be urged... --sd
Create an account or sign in to comment