cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
igalriga
Helper I
Helper I

Lock Fields on Monday

I have an app built where the user can enter data into many fields. 

 

What I want is when it is Monday, all fields are locked/not able to be edited, and a little note comes up on the top stating "Today is Monday, data is locked."

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

In the DisplayMode property for each field use the following

if(Weekday(Today()) = 1,DisplayMode.Disabled,DisplayMode.Enabled)

That will disable the control if its Monday.  Use a similar formula in the Visible property of the error label to display it on Monday

if(Weekday(Today()) = 1,true, false)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

In the DisplayMode property for each field use the following

if(Weekday(Today()) = 1,DisplayMode.Disabled,DisplayMode.Enabled)

That will disable the control if its Monday.  Use a similar formula in the Visible property of the error label to display it on Monday

if(Weekday(Today()) = 1,true, false)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

It is saying that my function IF has invalid arguments.

 

If(Weekday(Today()) = 1,DisplayMode.Disabled,DisplayMode.Enabled)

I just tested and the following is working for me in the DisplayMode property of a textbox.

If(Weekday(Today())=3,DisplayMode.Disabled, DisplayMode.Edit)

Its Tuesday and my calendar is set to start with Sunday.  So Monday=2 Tuesday=3



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,372)