cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sumeesh
Helper II
Helper II

Edit and Disable Mode based upon the Current Month Date

Hello All, 

Below is my scenario:-

all the 1st to 4th week should depend upon the forecasting dateall the 1st to 4th week should depend upon the forecasting date

 

 1st to 4th Week text box will have data in numerical and the Forecasting date text box will be in date format. All the text boxes (1st to 4th Week) depend on Forecasting date value. 

Note:- Forecasting date  = (DataCardValue14) 

and 1st Week  = (DataCardValue16)

 

for my case the 1st-Week, the "1st Week text box" can be edited from 1st to 7th day of the month and rest all days the "1st-week text box" should be disabled.

ex:- from 1st to 7th April, the text box can be edited and the rest of the month in disable mode (greyed out).

 

for the 2nd Week. the "2nd Week text box" can be edited from 7th to 14th day of the month and rest all days of the month "2nd-week text box" should be disabled.

 

for the 3rd Week, the "3rd Week text box can be edited from 15th to 21st day of the month and rest all days of the month "3rd-week text box" should be disabled.

 

for the 4th Week, the "4th Week text box" can be edited from 22nd to 31st day of the month, and all days of the month "4th-week text box" should be disabled.

 

Let me know in case of any confusion or unclear part in my question.

 

Thanks and Regards,

S

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@Sumeesh 

Put these code snippets in the DisplayMode property of each Text Input

 

1st Week

If(Day(DatePicker_ForecastingDate.SelectedDate) <= 7,
    DisplayMode.Edit,
    DisplayMode.View
)

 

2nd Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 8 And Day(DatePicker_ForecastingDate.SelectedDate) <= 14,
    DisplayMode.Edit,
    DisplayMode.View
)

 

3rd Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 15 And Day(DatePicker_ForecastingDate.SelectedDate) <= 21,
    DisplayMode.Edit,
    DisplayMode.View
)

 

4th Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 22,
    DisplayMode.Edit,
    DisplayMode.View
)


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User III
Super User III

@Sumeesh 

Put these code snippets in the DisplayMode property of each Text Input

 

1st Week

If(Day(DatePicker_ForecastingDate.SelectedDate) <= 7,
    DisplayMode.Edit,
    DisplayMode.View
)

 

2nd Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 8 And Day(DatePicker_ForecastingDate.SelectedDate) <= 14,
    DisplayMode.Edit,
    DisplayMode.View
)

 

3rd Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 15 And Day(DatePicker_ForecastingDate.SelectedDate) <= 21,
    DisplayMode.Edit,
    DisplayMode.View
)

 

4th Week

If(Day(DatePicker_ForecastingDate.SelectedDate) >= 22,
    DisplayMode.Edit,
    DisplayMode.View
)


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@Sumeesh 
Did my suggestion help here?  Please let me know.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney Thanks a lot!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (44,887)