I would like to allow a model user to flag ONE member of a list as the "base item". If the user changes a leaf-level list item's "base item" flag to TRUE, then all other leaf-level list items that were previously marked TRUE should be marked FALSE. One and only one item must be "base item" = TRUE at any given time.
(Use case: Calculated line items will use this information to either compute values from inputs for all "base item" = FALSE items. For the one "base item" = TRUE item, the calculation applies different logic that "plugs" the remainder.)
Solved! Go to Solution.
Hi,
There are lots of ways to do this, but I think this is the easiest (if the parent list is a separate list): select the TRUE leaf item at the parent level (i.e. create a module that includes the parent list, and then add a line item that is formatted to the Child/Leaf list, and select the one leaf item there... and then set the booleans accordingly at the leaf level, based on that single parent level (leaf) selection. This is simple & has the benefit of not permitting more than one leaf item to ever be selected. However, if the parent is in the same list as the leafs, then you can't use this.
If the parent is in the same list as the leafs, another way to do this is as follows:
If you really want to get snazzy, and if there aren't too many users in the system at a time, and perhaps if the list containing your leaf items isn't too big, then you could create a bulk process where user's would be able to (just throwing mud at the wall here): select leaf you want to be true... and then click a button that loads a TRUE to that leaf while loading falses to all of that leaf's siblings. There are a couple of nuances here that would need to be thought through and unit tested. For example, what list will you use in the selection module?... could be a user list. You probably still want to audit the process as a whole... so you might include some elements of the 2nd option anyway.
Cheers!
Paul