web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I set the calen...
Power Apps
Unanswered

How do I set the calendar to not allow dates before today's date?

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

cds_issue9.PNG

 

 

 

I have a entity form in portal that has a date-picker. I only want to be able to choose only the current or future dates and not the past ones.

 

Is there any possible way to solve this issue?

 

Regards,

Ahmad

I have the same question (0)
  • Verified answer
    Joel CustomerEffective Profile Picture
    3,224 on at

    that is a really good question, and just using a date field, the answer is no.

    Consider using a real-time workflow process with check condition if date is less than process execution time.

    create your workflow in classic settings. uncheck the run in background checkbox.  have it run on create of the record and set scope to organization.

    add a check condition step

    for condition choose your entity, your date field, is less than operator, and for the "enter value" use the form assistant and choose "process" in look for and select the execution time field. This is the date time when the record is being created.

    You can then surface an error and prevent saving of the record. https://jukkaniiranen.com/2013/11/using-real-time-workflows-to-show-error-messages/

     

    that way if someone selects a date in the past they get an error in which you can tell them to select a date in the future.

  • David Jennaway Profile Picture
    716 on at

    You could use client script to prevent entry of dates before today's date, The simplest option would be validate the date either when the value is entered, or when the data is to about to be saved. This would give a more immediate response than using a workflow

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    If you're looking for a low code/no code solution there's this opensource Portal Business Rules, it's not super well documented but it does the trick: https://transform365.blog/2019/10/01/business-rules-for-powerapps-portals-v1/

     

    There's also this helper Portal JavaScript library done by AK that I've been using: https://github.com/dynamicscode/XrmPortalJS

    To prevent past dates: 

    Xrm.Portal.Form.Validation.denyPastDate(attributename, message, [isRequired])

    Hope this helps!

     

     

     

  • efisher Profile Picture
    52 on at

    https://github.com/BIDSL/PCFControls/wiki/Customizable-Date-Picker

    This control works as needed in model apps. posting link as this post is the first one coming up in search results for limiting date picker in model apps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard