I currently have a button that when clicked, is supposed to lock certain fields on my app from being edited.
The OnSelect for the button is:
Set(varLockFields, DisplayMode.Disabled)
And then for the fields I want it to be locked, I put "varLockFields" on the DisplayMode setting.
It doesn't work for some reason. Any advice?
Also, if I want the button to toggle if it's locked or not, how would I do that?
Solved! Go to Solution.
Ok so what I am getting is that on day 2&3 it should ALWAYS be locked, but on any other day it should be open UNLESS someone clicks the button then it will lock and unlock based on their button press which would go like this
Switch(
Weekday(Today()),
2, DisplayMode.Disabled,
3, DisplayMode.Disabled,
If(
IsBlank(varmode),
DisplayMode.Edit,
varmode)
)
I just tested this with a button that has the onselect of
Switch(varmode,DisplayMode.Disabled,Set(varmode,DisplayMode.Edit),Set(varmode,DisplayMode.Disabled))
and set display mode of a checkbox to varmode
worked perfectly
Thanks for that. It seems like it works.
How do I put multiple conditions in the DisplayMode field?
I currently have:
If(Or(Weekday(Today())=2, Weekday(Today())=3), DisplayMode.Disabled, DisplayMode.Edit)
I thought I could do something like this but it doesn't work:
If(Or(Weekday(Today())=2, Weekday(Today())=3),DisplayMode.Disabled, DisplayMode.Edit);
varmode
Explain to me what it is you want that to do, because in your example you are just saying Display Mode; Second Display Mode. Not OR or If like I assume you intend. Just type out in a regular sentence i want the app to check this then this and do this or this etc
So I have fields that are supposed to lock for everybody on Monday and Tuesday, which currently works fine with this line:
If(Or(Weekday(Today())=2, Weekday(Today())=3), DisplayMode.Disabled, DisplayMode.Edit)
I then have a button where only certain users can click and will lock those same fields manually. You switch line allowed that to work, but when I try to add a second DisplayMode code, I get an error.
Ok so what I am getting is that on day 2&3 it should ALWAYS be locked, but on any other day it should be open UNLESS someone clicks the button then it will lock and unlock based on their button press which would go like this
Switch(
Weekday(Today()),
2, DisplayMode.Disabled,
3, DisplayMode.Disabled,
If(
IsBlank(varmode),
DisplayMode.Edit,
varmode)
)
User | Count |
---|---|
247 | |
106 | |
82 | |
50 | |
43 |