Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How to hide future dates in the date dropdown

(1) ShareShare
ReportReport
Posted on by 524
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,429 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,729 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 491 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 19,457 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 10,169 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 10,169 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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans