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":
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!
Comments
RIS Plus, LLC
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.
Anyway, for the OK button: this will give you the selected date:
"Period Start" + DATE2DWY(CurrForm.Matrix.MatrixRec."Period Start",1) - 1
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
3,360 Sales & Receivables - Calendars
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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 date
Business Applications/IT Advisor, Competitive Edge Services
clear(lfrmDatePicker.) ; //new line.
lfrmDatePicker.SetCurrDate(TODAY);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Business Applications/IT Advisor, Competitive Edge Services