Hi, I have a column โOrder Statusโ which is ENUM [Pending,Started,Finished,Cancelled], and
I wish to block the user to save record
when user
change from Pending to Finished, or
change from Started Back to Pending, or
change from Finished to Cancelled or
change from Cancelled to Finished or
change from Cancelled to Started or
change from Cancelled to Pending
Can any one help to advice me please, thanks.
Solved! Go to Solution.
Hi Aurelien,
thanks for the advice and idea,
what works for me is as follow,
SWITCH([Order Status],
โPendingโ, LIST(โFinishedโ),
โStarted Backโ, LIST(โPendingโ),
"Finished ", LIST("Cancelled "),
LIST(โFinishedโ,โStartedโ,โPendingโ)
)
when is cancelled, they canโt switch it back and
when is finished, they canโt switch it back.
solved.
Hi @kalmen_chia
Welcome to the community.
You may wish to use the Suggested Value field, with a SWITCH expression.
Here is the documentation:
Your expression you are looking for could be something like:
SWITCH([Order Status], "Pending", LIST("Finished"), "Started Back", LIST("Pending"), "Finished ", LIST("Cancelled "), LIST("Finished","Started","Pending") )
Please note that the last input is a default value.
Let us know if that works for you !
Hi Aurelien,
thanks for the advice and idea,
what works for me is as follow,
SWITCH([Order Status],
โPendingโ, LIST(โFinishedโ),
โStarted Backโ, LIST(โPendingโ),
"Finished ", LIST("Cancelled "),
LIST(โFinishedโ,โStartedโ,โPendingโ)
)
when is cancelled, they canโt switch it back and
when is finished, they canโt switch it back.
solved.
Valid If instead:
(
LIST([Order Status])
+ SWITCH(
[Order Status],
"Pending",
LIST("Started", "Cancelled"),
"Started",
LIST("Finished", "Cancelled"),
"Finished",
LIST(),
"Cancelled",
LIST("Finished"),
LIST("Pending", "Started", "Finished", "Cancelled"),
)
- LIST("")
)
Hi @Steve,
Thanks for your correction.
That distinction isnโt very clear for me: in which case is it more pertinent to use the Suggested_value, in which case it is the Valid_if ?
Suggested values produces a dropdown from which the user may choose, or the user may enter another value. Suggested values does not itself prevent the user from entering an arbitrary value. To prevent the user from entering some other value, you must use both Suggested values and Valid If, or just Valid If.
Awesome, thanks for that
Thanks all for the help.
User | Count |
---|---|
36 | |
33 | |
27 | |
23 | |
18 |