Dataport: Import file - Problem in Request Form

cosch1cosch1 Member Posts: 37
Hi experts,
i try to import a file as 'Gen. Journal Line'. It shouldn't be problem. I wan't to give over some variables in the request form.
The variable 'FileName' has the ID 1 so that it should work, but it doesn't.
NAV sais that the file couldn't be found so that I think, that the FileName wasn't given over?!

Please help......

Greatings from germany!
cosch1

Answers

  • crisnicolascrisnicolas Member Posts: 177
    FileName is a global variable you've created, right?
    You have to tell NAV that this is the FileName for the dataport

    CurrDataport.FILENAME := FileName
  • cosch1cosch1 Member Posts: 37
    FileName is a global variable you've created, right?
    You have to tell NAV that this is the FileName for the dataport

    CurrDataport.FILENAME := FileName

    Thanks a lot for answering!
    I've created it as a global variable, text length 250.
    Now i told "him" that he's the FileName, but the result is the same....

    Have you got another idea??????
  • crisnicolascrisnicolas Member Posts: 177
    In which trigger have you put that piece of code?
  • cosch1cosch1 Member Posts: 37
    In which trigger have you put that piece of code?

    JournalLine - OnPreDataItem()
    FileName2 was only a test, but it doesn't work too.....
  • SavatageSavatage Member Posts: 7,142
    is it some complicated filename & path?
    Perhaps try for a test rename the file and put it in c:\

    c:\test.txt
    see if that works
  • crisnicolascrisnicolas Member Posts: 177
    The dataport opens the specified file before that.... so, when it is trying to open the file, CurrDataport.FILENAME doesn't have a value yet.

    You should place that code on the OnPreDataport trigger
    You should also use CurrDataport.IMPORT to tell the dataport if it has to import or export the data
    Import
    Use this property to determine whether the dataport imports or exports data.

    Applies to
    Dataports

    Settings
    The Import settings are:

    To...
    Choose...

    Import data to a C/SIDE table Yes (default)
    Export data to an external file No
  • cosch1cosch1 Member Posts: 37
    Savatage wrote:
    is it some complicated filename & path?
    Perhaps try for a test rename the file and put it in c:\

    c:\test.txt
    see if that works

    i did it, same result..... If I only put the variable "FileName" into the request form, it works!
  • matttraxmatttrax Member Posts: 2,309
    You should place that code on the OnPreDataport trigger

    Did you try that one? That's what needs to be done. Before the dataport begins processing ANYTHING it has to have a filename. That processing begins when OnPreDataport finishes.
  • cosch1cosch1 Member Posts: 37
    The dataport opens the specified file before that.... so, when it is trying to open the file, CurrDataport.FILENAME doesn't have a value yet.

    You should place that code on the OnPreDataport trigger
    You should also use CurrDataport.IMPORT to tell the dataport if it has to import or export the data
    Import
    Use this property to determine whether the dataport imports or exports data.

    Applies to
    Dataports

    Settings
    The Import settings are:

    To...
    Choose...

    Import data to a C/SIDE table Yes (default)
    Export data to an external file No

    it sounds good, but -sorry - i don#t find the "OnPreDataport trigger"..... What's the way to find it????
    I'm to stupid...... #-o
  • cosch1cosch1 Member Posts: 37
    cosch1 wrote:
    The dataport opens the specified file before that.... so, when it is trying to open the file, CurrDataport.FILENAME doesn't have a value yet.

    You should place that code on the OnPreDataport trigger
    You should also use CurrDataport.IMPORT to tell the dataport if it has to import or export the data
    Import
    Use this property to determine whether the dataport imports or exports data.

    Applies to
    Dataports

    Settings
    The Import settings are:

    To...
    Choose...

    Import data to a C/SIDE table Yes (default)
    Export data to an external file No

    it sounds good, but -sorry - i don#t find the "OnPreDataport trigger"..... What's the way to find it????
    I'm to stupid...... #-o

    I found it!!!! It works!!!!! Many thanks to all!!!!

    :D

    Greetings from germany!
Sign In or Register to comment.