cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FGSDGF
Regular Visitor

LEAVE REQUEST - Unable to send a leave request with date before today

Hello team,

 

I have implemented the leave request app in my organization about 4 months ago. everything is working fine so far.

 

I have only one issue of when someone tries to submit a leave request after the fact. The app does not allow for the start date to be in the past.

 

Is there a way to overcome this?

 

Thank you,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Dual Super User
Dual Super User

Hi @FGSDGF,

There are some small changes you have to make to fulfill your expectation. You didn't mention what kind of app have you implemented (Phone or Tablet). Let's see both of them:

 

1. LeaveRequest (Tablet version)

Go to Screen - NewRequest Screen and make the following changes:

Label1_13 -> Text: 

If(LeaveStartDatePicker.SelectedDate > LeaveEndDatePicker.SelectedDate, "Start date must occur on or before end date") 

In this way, you'll eliminate the warning message about StartDay < Today() (what you are looking for ...)

Button1_1->DisplayMode:

If(IsBlank(Trim(TextInput1.Text)) || IsBlank(LeaveStartDatePicker.SelectedDate) || IsBlank(LeaveEndDatePicker.SelectedDate) || LeaveEndDatePicker.SelectedDate < LeaveStartDatePicker.SelectedDate || IsBlank(_selectedLeaveType) || IsBlank(_selectedApprover), DisplayMode.Disabled, DisplayMode.Edit)

Here I removed LeaveStartDatePicker.SelectedDate < Today() that will allowed you to send request from past days.

 

2. LeaveRequest(Phone version)

It seems that Phone version hasn't implemented a restriction regarding the StartDay vs. CurrentDay so the only change you have to make is to reconsider the warning text.

So, go to SelectDatesScreen and make the following changes:

Label1 -> Text

If(LeaveStartDatePicker.SelectedDate > LeaveEndDatePicker.SelectedDate, "Start date must occur on or before end date")

 

Hope it helps !

View solution in original post

3 REPLIES 3
gabibalaban
Dual Super User
Dual Super User

Hi @FGSDGF,

There are some small changes you have to make to fulfill your expectation. You didn't mention what kind of app have you implemented (Phone or Tablet). Let's see both of them:

 

1. LeaveRequest (Tablet version)

Go to Screen - NewRequest Screen and make the following changes:

Label1_13 -> Text: 

If(LeaveStartDatePicker.SelectedDate > LeaveEndDatePicker.SelectedDate, "Start date must occur on or before end date") 

In this way, you'll eliminate the warning message about StartDay < Today() (what you are looking for ...)

Button1_1->DisplayMode:

If(IsBlank(Trim(TextInput1.Text)) || IsBlank(LeaveStartDatePicker.SelectedDate) || IsBlank(LeaveEndDatePicker.SelectedDate) || LeaveEndDatePicker.SelectedDate < LeaveStartDatePicker.SelectedDate || IsBlank(_selectedLeaveType) || IsBlank(_selectedApprover), DisplayMode.Disabled, DisplayMode.Edit)

Here I removed LeaveStartDatePicker.SelectedDate < Today() that will allowed you to send request from past days.

 

2. LeaveRequest(Phone version)

It seems that Phone version hasn't implemented a restriction regarding the StartDay vs. CurrentDay so the only change you have to make is to reconsider the warning text.

So, go to SelectDatesScreen and make the following changes:

Label1 -> Text

If(LeaveStartDatePicker.SelectedDate > LeaveEndDatePicker.SelectedDate, "Start date must occur on or before end date")

 

Hope it helps !

It worked perfectly ! Thanks a million

 

I am using the tablet mode by the way.

AnilkumarM
Frequent Visitor

Hi @gabibalaban 

 

When we are sending a leave request from one time zone to another time zone manager. the date that we apply are getting changed. 

 

Ex : Philippines Employee selected 28-29 November leave and the manager in USA will see as 27-28 November. So this is happening with other timezones as well. 

 

please help how we can sort this out. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,503)