Open File from button

valkatamakevalkatamake Member Posts: 38
Hi, i'm new to navision and I have to make button who can open file from file path

C/AL code for the path is


OnAssistEdit()
CLEAR ( cmndlg ) ;
"File Path":=cmndlg.OpenFile('Open File','',1,'',0);


where cmndlg is codeunit 412

I've made the button from toolbox but after that i'm stuck

Please help

Comments

  • garakgarak Member Posts: 3,263
    edited 2008-06-27
    your source is ok to select the file but whats now your problem :?:

    do you will read the data from the file and store the data into a table or what?

    Regards
    Do you make it right, it works too!
  • McClaneMcClane Member Posts: 40
    Code works fine if used with a textbox. What kind of object do you use? It can´t be a command button ... :-k
  • garakgarak Member Posts: 3,263
    ist not a button, it's a textbox McClane ;-)
    Do you make it right, it works too!
  • valkatamakevalkatamake Member Posts: 38
    example:
    i choose some text file in file path
    then i have to push the button and the default text reader must open the text file (notepad in my case)
  • valkatamakevalkatamake Member Posts: 38
    please help
  • McClaneMcClane Member Posts: 40
    hyperlink('textfile.txt');
  • garakgarak Member Posts: 3,263
    or you use WSHShell.Run() <-- search the forum

    here an examples:

    http://www.mibuso.com/forum/viewtopic.p ... =open+file

    regards
    Do you make it right, it works too!
  • valkatamakevalkatamake Member Posts: 38
    McClane wrote:
    hyperlink('textfile.txt');

    where i have to type it ?

    in the button c/al code?

    i'm really new to navision
  • garakgarak Member Posts: 3,263
    behind your trigger
    OnAssistEdit()
    CLEAR ( cmndlg ) ;
    "File Path":=cmndlg.OpenFile('Open File','',1,'',0);
    hyperlink("File Path");
    

    But i would use WSH (Windows Scripting Host)

    Regards

    Tip: Read the C/AL manuals on CD / DVD
    Do you make it right, it works too!
  • dspasovdspasov Member Posts: 33
    Hi,
    Try this:

    OnAssistEdit()
    CLEAR ( cmndlg ) ;
    shell('C:\WINDOWS\notepad.exe' ,cmndlg.OpenFile('Open File','',1,'',0));
  • valkatamakevalkatamake Member Posts: 38
    Thanks.
  • garakgarak Member Posts: 3,263
    please write [Solved] in your subject if your post is finished.

    Thanks
    Do you make it right, it works too!
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello to all,

    I have four types of informations regarding the imported file.

    Field Name Datatype

    File Name Text
    File Size decimal
    File Data Blob
    Content Type Text

    Now I want to open the imported file without exporting it to HDD by clicking 'Open File'
    command button.
    How to export that I know. but I want to open it directly.
    Please help me.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.