Dialog Input

SbhatSbhat Member Posts: 301
Hi Folks,

In the below code when i enter 'T' in my input it returns 3/28/06 instead of todays date. It assumes T for Tuesday. idea how do i get to print Todays date.

w.OPEN('Enter todays date ##1#######');
w.INPUT(1,tdate);

MESSAGE('%1',tdate);

Regards
SB.

Comments

  • ara3nara3n Member Posts: 9,257
    Hello Sbhat
    I saw this as well today filtering in object designer on t and it would change to tuesday. It stopped doing it now. So I don't know how this happened.


    I would set tdate := today as default. That way they don't have to put anything in there.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SbhatSbhat Member Posts: 301
    Hi Rashed,

    Unfortunately 'tdate' is a user input and i cannot force it as today. The weird part is tdate is a variable of type 'Date' and i dont understand why it does not like 'T' and considers it as Tuesday instead of Today.

    Regards
    SB.
  • easabanganeasabangan Member Posts: 114
    Try using this code :

    W.OPEN('Enter todays date' + '#1#######');
    W.INPUT(1,txtDate);
    W.CLOSE;
    IF UPPERCASE(txtDate) = 'T' THEN
       tDate := TODAY
    ELSE
       EVALUATE(tDate, txtDate);
    
    
    MESSAGE('%1',tDate);
    


    Note : txtDate has the data type of text.
    No future at CPI
  • ara3nara3n Member Posts: 9,257
    Sure you can force it
    w.OPEN('Enter todays date ##1#######');
    tdate := today;
    w.INPUT(1,tdate);
    
    MESSAGE('%1',tdate);
    


    I would actually report this to MS. It is definitely a bug.
    Personally, I don't use dialogs for inputs. They have horrible user interface, and slow performance, in terms that if you have in middle of your routine, other people will be locked out.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,118
    ara3n wrote:
    ...slow performance, in terms that if you have in middle of your routine, other people will be locked out.
    If you update your dialogbox every loop, yes it slows down a lot. But if you update the dialogbox less (lets say once every 3 seconds) it doesn't slow down. I always use a slider that I update once every 3 seconds.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kinekine Member Posts: 12,562
    to Kriki: yes, but this is about Input Dialog box, which is waiting for the user input during the opened transaction. It means same problems like Confirm in transaction... big deadlocks, lock chains etc... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,257
    Thanks kine :)
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,118
    :oops: didn't read the code-part in the post of ara3n. I was only thinking about progress bars.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.