Semi-automatic Date Picker on every Date field - in 3 steps

Waldo
Member Posts: 3,412
I know I know .. Probably all of you already implemented it, but for those who didn't … here's how 
Probably everybody knows the functionality when putting a question mark ('?') into a text field, that the standard text functionality pops up?
Well, I've got an easy-to-create variant of this for dates.
What do you have to do?
1. Download the Date Time Picker from Mibuso: http://www.mibuso.com/dlinfo.asp?FileID=563 (thanks Woody)
2. Import it in your database (obviously you don't need the sample form)
3. Add this code to codeunit 1 in trigger "MakeDateText" (create a local variable of the type "form" for your Date Picker":
It might be that you have to restart your client.
Now just put a ' ' or a '?' into a date field and there is your date picker.
Enjoy!

Probably everybody knows the functionality when putting a question mark ('?') into a text field, that the standard text functionality pops up?
Well, I've got an easy-to-create variant of this for dates.
What do you have to do?
1. Download the Date Time Picker from Mibuso: http://www.mibuso.com/dlinfo.asp?FileID=563 (thanks Woody)
2. Import it in your database (obviously you don't need the sample form)
3. Add this code to codeunit 1 in trigger "MakeDateText" (create a local variable of the type "form" for your Date Picker":
IF DateText IN ['?',' '] THEN BEGIN lfrmDatePicker.SetCurrDate(TODAY); lfrmDatePicker.LOOKUPMODE(TRUE); IF lfrmDatePicker.RUNMODAL = ACTION::LookupOK THEN BEGIN DateText := FORMAT(lfrmDatePicker.GetCurrDate); END; END;
It might be that you have to restart your client.
Now just put a ' ' or a '?' into a date field and there is your date picker.
Enjoy!
0
Comments
-
Excellent tip! It's almost an MVT (Most Valuable Trick) ;-)No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
-
In the past I remember using the Monthly Calendar (7609) form for this.
It is a brilliant matrixform to pick dates and available in almost every navision database.
Just add an OK button on it and return the selected date when pushed.0 -
The granules are
3,360 Sales & Receivables - Calendars0 -
How do you guys do this with the Monthly Calendar control?
I added this in the MakeDateText trigger of CodeUnit 1.
lfrmDatePicker is now a variable of Form "Monthy Calendar".
IF DateText IN THEN BEGIN
// lfrmDatePicker.SetCurrDate(TODAY);
lfrmDatePicker.LOOKUPMODE(TRUE);
IF lfrmDatePicker.RUNMODAL = ACTION::LookupOK THEN BEGIN
END;
END;
How do you add the return value to the OK button?
The pushaction of my button is LookupOK
But where do you add the line: "Period Start" + DATE2DWY(CurrForm.Matrix.MatrixRec."Period Start",1) - 1
Is this the RunCommand?
Cause i cannot get it to work the return the selected date0 -
allright, got it working0
-
Hi - I am trying out the Date Picker in NAV2009R2. After selecting a date with the Date Picker, if I go directly to the next date field and type '?', I get an error: "The form has been run. Use the function CLEAR(Form)". Has this been reported, and is there a fix? Thanks...Leanne G. Paul
Business Applications/IT Advisor, Competitive Edge Services0 -
you need to add the following line.
clear(lfrmDatePicker.) ; //new line.
lfrmDatePicker.SetCurrDate(TODAY);0 -
Thanks!Leanne G. Paul
Business Applications/IT Advisor, Competitive Edge Services0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions