mibuso.com

Microsoft Business Solutions online community
It is currently Wed Jul 30, 2014 12:54 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Semi-automatic Date Picker on every Date field - in 3 steps
PostPosted: Mon Aug 06, 2007 5:22 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Fri Dec 06, 2002 11:50 am
Posts: 3397
Location: Kontich, Belgium
Country: Belgium (be)
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":

Code: Select all
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!

_________________

Eric Wauters
MVP - Microsoft Dynamics NAV
My blog


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 9:17 pm 
Offline
Site Admin
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Sun Nov 07, 1999 8:01 am
Posts: 3493
Location: Wilrijk
Country: Belgium (be)
Excellent tip! It's almost an MVT (Most Valuable Trick) ;-)

_________________
No support using PM or e-mail - Please use this forum.
Search is your friend || Mark your Topic as SOLVED (= green checkmark) when your question is answered || Read the Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2014 - 20 & 21 November 2014 ««« Visit the conference website: www.navtechdays.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 8:57 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7989
Location: Howell, MI
Country: United States (us)
Brilliant!! :mrgreen:

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 10:58 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Tue Jul 19, 2005 4:49 pm
Posts: 4175
Location: Olst
Country: Netherlands (nl)
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.


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 6:53 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Fri Dec 06, 2002 11:50 am
Posts: 3397
Location: Kontich, Belgium
Country: Belgium (be)
Indeed, but do you know which granule is needed for this form?

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 7:46 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
The granules are

3,360 Sales & Receivables - Calendars

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: Semi-automatic Date Picker on every Date field - in 3 steps
PostPosted: Thu Oct 23, 2008 12:21 pm 
Offline

Joined: Thu Aug 23, 2007 3:51 pm
Posts: 288
Location: Gent
Country: Belgium (be)
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 date


Top
 Profile  
 
 Post subject: Re: Semi-automatic Date Picker on every Date field - in 3 steps
PostPosted: Thu Oct 23, 2008 1:14 pm 
Offline

Joined: Thu Aug 23, 2007 3:51 pm
Posts: 288
Location: Gent
Country: Belgium (be)
allright, got it working


Top
 Profile  
 
 Post subject: Re: Semi-automatic Date Picker on every Date field - in 3 st
PostPosted: Fri Apr 27, 2012 8:01 pm 
Offline

Joined: Tue Aug 08, 2000 7:01 am
Posts: 58
Country: United States (us)
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...


Top
 Profile  
 
 Post subject: Re: Semi-automatic Date Picker on every Date field - in 3 st
PostPosted: Fri Apr 27, 2012 8:18 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
you need to add the following line.

clear(lfrmDatePicker.) ; //new line.
lfrmDatePicker.SetCurrDate(TODAY);

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: Semi-automatic Date Picker on every Date field - in 3 st
PostPosted: Fri Apr 27, 2012 8:22 pm 
Offline

Joined: Tue Aug 08, 2000 7:01 am
Posts: 58
Country: United States (us)
Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: