Hiding choices from choice list AND list editor??

shill
Mega Sage

We have a need to hide a choice in a choice list on the form AND from the list editor. Is this in any way possible?
We have a business rule that will set the choice list to this hidden value, but we do not want the users to be able to select this value from either the form or the list editor. This is the state field, so we do need to keep it open on the list editor for the other 'unhidden' choices.

3 REPLIES 3

tony_fugere
Mega Guru

There's not a way to perform a removeOption on the List view, so you could:

1. Limit the list_edit operation with an Access Control to keep people from changing the state at all from the list
2. Create a Before Update Business Rule that rejects the modification (


current.setAbortAction(true)
or

current.state = previous.state
) when

current.state.changesTo(7)
(or which ever state it is).
3. Setting the choice to Inactive = true removes it completely, but then it is fully unusable/unselectable


I know this is an old post, but I'm looking to pick an approach to this same situation right now, and I also see a fourth option:


4. Add an onCellEdit Client Script that passes a 'false' parameter to "callback" and could also do something like alert the user.


alert('You are not allowed to select "Closed" from the list view. Open the form view to see which options are actually available to you.');
callback(false);


Since this is very similar to Tony's second option of using a business rule, I'm wondering if anyone has an argument for any one approach over the others.



The Access Control is the cleanest and most secure for locking the field down entirely, but for only "removing" specific values, I think I actually like the Client Script approach because you can customize the behavior (e.g., populate an Alert with any explanation you want), but I suppose you could also add a custom InfoMessage or ErrorMessage in the Business Rule approach.



Are there maybe performance benefits to choosing one over the other?


randrews
Tera Guru

one other option...



have the choice list read the choices from a custom table with the options.. and put an acl on that table... so for example if you are having them select the priority, build a priority table and put the choices there... then   put acl's on priority to control visibility.. which would limit it everywhere