AnsweredAssumed Answered

Toggling multi-choice attributes

Question asked by davehob on Aug 14, 2013
Latest reply on Aug 19, 2013 by davehob

I’m in the process of re-writing an application in FM12, and there’s something I want to get right at this early stage.


In a People table, there are lots of attributes, such as disabled or not, gender, sexuality, etc. Some of these are simple Yes/No attributes (e.g. disabled), whilst others have 2 or more options. (Actually, these will be in a separate “attributes” table, but logically they are part of a People record.) I want to use Boolean fields wherever I can, to make the process of later analysis as easy as possible.


With a Yes/No attribute, it’s simply a case of having a field, “IsDisabled”, with a button that does:
Set Field [PPL::IsDisabled; not PPL::IsDisabled]
to toggle the field. A nice bit of conditional formatting on the button to show “on” or “off”, and all is well.

But what’s the best way to handle, say, the gender, or other attributes with up to 10 settings, where if one option is “on”, all others are “off”?

Ideally, a single script will run when user clicks on “Male” button, which will set “IsMale” to 1 and “IsFemale” to 0, but I can’t see how to do this without a multi-step script, which seems a bit elaborate. And where there are more options (e.g. ethnicity, sexuality, etc.) it gets more wordy still (i.e. unset all the Booleans, then set the one selected). Not a huge problem, admittedly, but I can’t help feeling there’s a better way to do it.

Or should I just have separate, value list-based fields, with separate Boolean calc fields (“IsMale”, “IsFemale”) set when Gender is entered or altered?