
Announcements
Hello!
I'm working on the Travel Expense App. The user is selecting the date range, for example from April 1st to April 5th by using date pickers control: "dateFrom" as date picker nr1, and "dateTo" as the second date picker.
This date range April 1st - April 5th is then patched to a Dataverse table "MT_Dates".
I would like to prevent the user to enter the same dates as previously, by either disabling those dates from the date picker, or by error message pop up, or some third option. As long as the user is unable to selected the dates that were already patched.
The code I'm using to Patch the dates from date pickers is:
Patch(
MT_Dates,
ForAll(
Sequence(
DateDiff(
dateFrom.SelectedDate,
dateTo.SelectedDate,
TimeUnit.Days
) + 1
),
{
'Selected dates':
DateAdd(
dateFrom.SelectedDate,
Value - 1,
TimeUnit.Days
)
}
)
)I have also attached the screens from my app and the screenshot of the Dataverse table, if it helps.
Thank you so much for reading my post and I look forward to your replies!