We often have situations (especially on status fields) were a user is only allowed to use certain element values or to move it from one element to one other element. The availability of a given element would be based on User permissions or current status (for example: if current status is A, you can only change it to B, and if current status is B you can only change to A or C, but not D).
The current ways of resolving these situations feel like workarounds, which should not be necessary for such a straightforward request in a platform called low code. Suggested solutions I have heard are:
- Create two (or more) similar Domains with similar, but not all, Elements and determine in the Layout procedure which one to show. This basically means adding (sort of) duplicate domains, which is ugly and risky from a maintenance perspective...
- Use a Lookup to a Table or View with Pre-filters. This is more effort, clutters the Data Model and is probably worse in performance than a Domain with Elements...
A possible solution that comes to mind is the ability to set in the Layout procedure when to show/hide certain Elements. It would be good enough if somehow the Layout procedure recognizes Domain with Element type of fields and we can write logic on each individual Element within that Domain.
How do you like this idea? If you have other suggestions than the Layout procedure to fix this: let's hear it!