Input Dialog

FishermanFisherman Member Posts: 456
Can anyone give me a quick example of how to use the Input Dialog? In other programming languages (like VB, for example) I can use an Input dialog to ask the user a question, and get an answer. Is this how it works in C/AL? Can anyone give me a quick example how?

Thanks.

Comments

  • ara3nara3n Member Posts: 9,256
    Hello Fissherman
    Yes you can use dialog for input. It's not recommended to ask for user input during a transaction. This is why navision built the most ugliest input dialog you could ever imagine.



    Window.OPEN('Please enter some text ###########1##',txt);
    Window.INPUT(1,txt);

    MESSAGE(txt);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    Yes, it is better to not use Input dialog if you don't need it and you can get the input in another way. Some aspects of behaviour of the input dialog are not good and sometime correct. (I never used it)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • FishermanFisherman Member Posts: 456
    Understood. Thanks, guys!
  • thaugthaug Member Posts: 106
    That input dialog is horrible. I have used it for some very limited things, but certainly not on anything that was transactional.

    The most frustrating thing about it is that it does not look like it would accept input. In the cases that I use it, I explicitly state what the user should do, and also tell them to hit the Enter key to accept, since it gives you nothing to push when you are done.
    There is no data, only bool!
  • zeninolegzeninoleg Member Posts: 236
    navision built the most ugliest input dialog you could ever imagine
    =D> =D> =D>

    I had to create my own dialog input window(using one of the forms) because it is so not user friendly
    Best Regards,
    Oleg
  • SavatageSavatage Member Posts: 7,142
    Ok Just to try it I created a command button on the item card.

    The plan is to open a dialog window - paste in some data copied off the internet and if it's ok place the info into 1 or 2 fields depending on the length.

    here's the code
    OnPush()
    CLEAR(ItemDetails);
    
    Item.GET("No.");
    
    Window.OPEN('Enter Text ##############1##',ItemDetails);
    Window.INPUT(1,ItemDetails);
    
    IF CONFIRM(ItemDetails,TRUE)
     THEN
      BEGIN
       Item."Additional Comments" := COPYSTR(ItemDetails, 1, 250);
       Item."Additional Comments2" := COPYSTR(ItemDetails,251,500);
       Item.MODIFY;
       Window.CLOSE;
        END
     ELSE
      BEGIN
       CLEAR(ItemDetails);
       Window.CLOSE;
    END;
    

    This will allow me to enter 500 characters into the dialog input box and split it into 2 fields if greater than 250.

    It all works fine if I type in the text but when I try to paste in text I copied off the internet it doesn't always work - many time the paste pastes nothing.

    any ideas?
  • zeninolegzeninoleg Member Posts: 236
    It all works fine if I type in the text but when I try to paste in text I copied off the internet it doesn't always work - many time the paste pastes nothing.

    Harry, I have same problem with some other applications, not only navision. Not even applications, I have tried to paste some copied text to the Internet form(was sending a mail) and it did not do a thing. My quess is the formatting that Internet uses.... but I am not sure 8-[
    Best Regards,
    Oleg
  • thaugthaug Member Posts: 106
    You copying this from a web browser I assume? If you use Firefox, they have an extension that will copy in plain text, which should eliminate the problem. Because of the sometimes strange formatting on HTML pages, I have problems copying text from many sites. One way I usually get around it is to first paste it in to Notepad, which usually works.

    You can download the extension here:
    https://addons.mozilla.org/firefox/134/
    There is no data, only bool!
  • prateekarya2011prateekarya2011 Member Posts: 40
    Thanks to all..... and especially team mibuso... topic was really helpful..
  • tinoruijstinoruijs Member Posts: 1,226
    Aha. "The Input method is obsolete". So it cannot be used anymore.
    I am looking for a easy way of inputting text in NAV 2013 R2 within NAV itself.
    Input should be in big text-fields and stored in the standard comment lines.
    Gonna look further.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Did you check DotNet variable Microsoft.VisualBasic.Interaction.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  • tinoruijstinoruijs Member Posts: 1,226
    Did you check DotNet variable Microsoft.VisualBasic.Interaction.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

    Not yet. Will do. Thanks!

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • mahmedmahmed Member Posts: 1
    Hi,

    I have developed a way to program the dialog box using the .net components. The only benefit you may be able to get from it is that you wont have to use an extra page.

    https://zexters.wordpress.com/2015/05/27/84/
  • Maria-SMaria-S Member Posts: 90
    What about nav extensions? What is now the preferred way to get simple input from user, and avoid using DotNet at the same time? :)
Sign In or Register to comment.