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.

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.

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,783)