Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to hide future dat...
Finance forum
Suggested answer

How to hide future dates in the date dropdown

Posted on by 522
Hi Guys,
 
In the date dropdown field we have all the dates like past and future dates, but I need to disable the future dates in d365fo. can you please help me to solve this.
  • Suggested answer
    Adis Profile Picture
    Adis 2,313 on at
    How to hide future dates in the date dropdown
    Hey,
     
    I would suggest the following.
     
    Take any form go to Options\Regord info\Database log (see 1) - it doesnt matter if you have the database log active on this table.
    In the created date and time column the to date (see 2) is the current date. Check in visual studio how that was implemented and reuse the code.
    For the "From date" you could just delete the entry, which will imply being 01/01/1900
     
     
     
    Kind regards, Adis
  • Komi Siabi Profile Picture
    Komi Siabi 12,637 Most Valuable Professional on at
    How to hide future dates in the date dropdown
    The date drop-down showing all dates is a system design and you won't be able to change it. However, you should be able to control it individually on tables. 
     
    By the way, like Amine said, you can validate the date. 
  • Raj Borad Profile Picture
    Raj Borad 420 on at
    How to hide future dates in the date dropdown
    Hi,
    What is the reason for such requirement?
  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 18,560 Super User 2024 Season 2 on at
    How to hide future dates in the date dropdown
    Hello,
     
    You could create a custom lookup form and filter out future dates.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,356 Super User 2024 Season 2 on at
    How to hide future dates in the date dropdown
    Hi @Adam123,
     
    it's better to use validation to prevent the user to select a future dates.
     
    for e.g. you can use the validateWrite in your table or datasoure in form :
    public boolean validateWrite()
    {
        boolean ret;
    	ret = super();
    	
    	if(this.yourDateField > SystemDateGet())
    	{
    		ret = checkFailed("your message here");
    	}
    	
    	return ret;
    }
    Best regards,
    Mohamed Amine MAHMOUDI
  • Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,356 Super User 2024 Season 2 on at
    How to hide future dates in the date dropdown
    Moved from MS Dynamics AX Form

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans