Dataport: Import file - Problem in Request Form

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

  • 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
  • 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??????
  • In which trigger have you put that piece of code?
  • In which trigger have you put that piece of code?

    JournalLine - OnPreDataItem()
    FileName2 was only a test, but it doesn't work too.....
  • 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
  • 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
  • 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!
  • 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.
  • 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
  • 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!