2 of 2 people found this helpful
Sometimes in these cases, it's easier to create a simple table of values, rather than just a value list. You can't really subgroup value lists at all, so you'd have to explore an alternative, like using a webviewer based value list selection which can be pretty tricky to nail for integrating.
What does adding a table get you? In this case, it would allow you to display a layout based list view instead of a checkbox set of your values. You could then subsummarize the list view for each of your categories, placing a button on each row that selects those subtype categories. You could also use alternate row styling as well to have a really nice looking selection list.
You could also drop the "subtypes" records into a portal, then use a portal trick technique to "group" those together (calculation heavy, so I wouldn't do it if you have hundreds of subtypes)
Here's an example: A Very Nice Way to Format a Sorted Portal Using Conditional Formatting
Faster than trying to do a webviewer setup.
Lastly, using the new Card window in FM16, or something like slide controls to switch between type and subtype selections can make for some good UI integrations.
You're probably wondering now how a user would "Check" those items off. I would place a checkbox on the layout with your "subtype" table for each subtype record, EG Subtypes::checkmark. Then I would script a "save" button that gathered up the checked items like so, saving them to the main record before clearing them.
Set variable [ $checklist ; ExecuteSQL("SELECT valuename FROM subtypes WHERE checkmark = 1";"";"") ]
Show All Records
Replace Field Contents [ subtypes::checkmark ; "" ]
Close Window [ current window ] //CLOSE A CARD WINDOW IF YOU OPENED IT
Set Field [ MainTable::Subtypes ; $checklist ]
If you need to pop open that card window and "populate" the checkboxes from the main record so you can edit the values, you can reverse the logic in the above script:
Set variable [ $checklist ; MainTable::Subtypes ]
New Window [ Card ; Layout: Subtypes Layout ; Name: "Select Subtypes" ]
Show All Records
Sort Records [ no dialog ; subtypes::category ]
Go To Record [ First ]
If [ PatternCount( $checklist ; subtypes::valuename ) > 0 ]
Set Field [ subtypes::checkmark ; 1 ]
Exit Loop if [ Get(RecordNumber) = Get(FoundCount) ]
Go To Record [ Next ]
Scroll Window [ Home ]
This is a lot to take in, and advanced stuff to integrate. If you have specific questions let me know!
Thanks for the response Mike,
I think I see what you're getting at but I may need to try when I am in the right frame of mind as it seems more advanced than I am used to!
I will respond here when I have had a chance to experiment with it properly to let you know how I got on
From my smart phone:
you might also use the magnifying glass tool to search this forum for:
"Adventures in FileMaking" to find a pair of teaching files that provide examples of different techniques for choosing an item from a list. #1 deals with different options for conditional value lists and #2 shows other options such as using selection portals. Both come with detailed documentation on how each technique works. Both files contain download links to the other file.